How to use the same plugin/visitor with different configurations?

9 views
Skip to first unread message

Carsten H.

unread,
Mar 12, 2017, 9:02:37 AM3/12/17
to walkmod
Moin!

I would like to use the same plugin/visitor multiple times with different configurations.

The following does not work but instead merges the parameters and I end up having only one visitor.
Looking at the code it's obvious, why this happens. 
What should be changed to make this work?

     <transformations>
                <transformation name="pass1" type="my-refactor" isMergeable="false">
                    <param name="pass">pass1</param>
                </transformation>
                <transformation name="pass2" type="my-refactor" isMergeable="false">
                    <param name="pass">pass2</param>
                </transformation>
      </transformations>

Cal

Raquel Pau Fernández

unread,
Mar 12, 2017, 10:42:45 AM3/12/17
to Carsten H., walkmod
Hi,

In the spring configuration file of your plugin, you should explicit singleton=false for your bean.

Raquel

--
You received this message because you are subscribed to the Google Groups "walkmod" group.
To unsubscribe from this group and stop receiving emails from it, send an email to walkmod+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carsten H.

unread,
Mar 14, 2017, 2:23:49 AM3/14/17
to walkmod, calbo...@gmail.com
 Hi Raquel,

thanks i will try that.

A few other questions if you don't mind ;-)

I have an ExtractInterfaceVisitor and an UseInterfaceWherePossibleVisitor I want to ececute both
in a single walkmod call.
They must be executed in separate rounds over all code and between the rounds the code has to recompiled
(nice caching test btw.).
How can I achieve that?

I am using the Stringwriter and when adding a reference to a qualified interface it adds an extra 4 spaces before printing the name, how to avoid that?

I want to know more about walkmod scripts, where can I find some info?

Greetings,
  Cal
To unsubscribe from this group and stop receiving emails from it, send an email to walkmod+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages