title: Java source code generation frameworks
body: <p>I have a set of Java 5 source files with old-style Doclet tags, comments and annotations. And based on that I would like to write a generator for another set of Java classes.</p>
  
  <p>What is the best way to do that? And are there any good standalone libraries for code analysis/generation in Java? Any shared exprience in this field is appreciated.</p>
  
  <p>So, far I have found these:</p>
  
  <ul>
  <li><p><a href="http://ws.apache.org/jaxme/js/jparser.html" rel="noreferrer">JaxME's Java Source Reflection</a> - seems good, but it does not seem to support annotations. Also it had no release since 2006.</p></li>
  <li><p><a href="http://annogen.codehaus.org/" rel="noreferrer">Annogen</a> - uses JDK's Doclet generator, which has some bugs under 1.5 JDK. Also it had no releases for a long time.</p></li>
  <li><p><a href="http://code.google.com/p/javaparser/" rel="noreferrer">Javaparser</a> - seems good as well and pretty recent, but only supports Visitor pattern for a single class i.e. no query mechanism like in the 2 above packages.</p></li>
  </ul>