A
Alex J
Hi all,
I need a annotation processing tool with the possibility to generate
source code.
What I want to do is to process specific annotations *and* generate
boilerplate code to the newly introduced classes that I plan to use
via ServiceLoader.
In fact, I can do that with Open JDK (by using the standard annotation
processing facility which is built-in to the javac compiler starting
from the Java 6), but deep type introspection and code generations
require to use sun-specific classes (basically com.sun.tools.javac.*)
which obviously is an ugly hack, not to mention that
(1) they change internal AST and Type tree representations from
release to release
(2) the interface to internal AST (JCTree descendants) is ugly - most
classes expose public fields, extensively use bit flags and have
complex and cluttered API.
I believe that there is a better way to do that (annotations
processing + type (AST) introspection + code generation) but I don't
know what tool I should use.
P.S.: I'm using maven and I'd like to do that in IDE-independent way.
P.P.S: Downgrading to JDK 5 is inappropriate.
I need a annotation processing tool with the possibility to generate
source code.
What I want to do is to process specific annotations *and* generate
boilerplate code to the newly introduced classes that I plan to use
via ServiceLoader.
In fact, I can do that with Open JDK (by using the standard annotation
processing facility which is built-in to the javac compiler starting
from the Java 6), but deep type introspection and code generations
require to use sun-specific classes (basically com.sun.tools.javac.*)
which obviously is an ugly hack, not to mention that
(1) they change internal AST and Type tree representations from
release to release
(2) the interface to internal AST (JCTree descendants) is ugly - most
classes expose public fields, extensively use bit flags and have
complex and cluttered API.
I believe that there is a better way to do that (annotations
processing + type (AST) introspection + code generation) but I don't
know what tool I should use.
P.S.: I'm using maven and I'd like to do that in IDE-independent way.
P.P.S: Downgrading to JDK 5 is inappropriate.