Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #7892
| From | Alex J <vstrength@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Annotations processing + type introspection + code generation |
| Date | 2011-09-12 06:21 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <b4cda2f5-442e-42f3-af75-5040215ba997@k15g2000yqd.googlegroups.com> (permalink) |
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.
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar
Annotations processing + type introspection + code generation Alex J <vstrength@gmail.com> - 2011-09-12 06:21 -0700
Re: Annotations processing + type introspection + code generation Robert Klemme <shortcutter@googlemail.com> - 2011-09-12 18:56 +0200
Re: Annotations processing + type introspection + code generation markspace <-@.> - 2011-09-12 10:04 -0700
Re: Annotations processing + type introspection + code generation Robert Klemme <shortcutter@googlemail.com> - 2011-09-12 19:22 +0200
Re: Annotations processing + type introspection + code generation Alex J <vstrength@gmail.com> - 2011-09-12 11:08 -0700
Re: Annotations processing + type introspection + code generation Alex J <vstrength@gmail.com> - 2011-09-12 11:00 -0700
Re: Annotations processing + type introspection + code generation Robert Klemme <shortcutter@googlemail.com> - 2011-09-12 20:21 +0200
Re: Annotations processing + type introspection + code generation Alex J <vstrength@gmail.com> - 2011-09-12 15:06 -0700
csiph-web