and, later, to change my code into this:
myClass c = new myClass(); c.process();
The problem is that I don't really have any idea about which code I need to write into the process() method to read the annotation values... I know that I should use the Reflection, but I really can't guess how can I do it...
@FurtherParams(p1="x", p2="y", p3="z") myClass c = new myClass(); c.process();
BenSchulz wrote:Actually - NO - it is more complex because the APIs do not provide a way to modify the source tree, so you'd have to roll your own way of doing that. Not impossible but is generally a can of worms. Also the annotation processing APIs (and indeed the reflection API) do not provide a standardised view of the code (including variables and their annotations) inside a method, so doing this in such a way that works with different compilers (for example the JDK's javac and the Eclipse IDE compiler) is more than you might think.
Might be simpler than that though.
With kind regards