I'm interested in metaprogramming (i.e. programs that help programmers do tedious programming tasks). I'm looking for a tool which has the following properties:

  • usable both at compile time and runtime;
  • inspects program structure;
  • can add new classes, methods or fields and make them visible to Java compiler;
  • can change behavior of methods;
  • Java-based (well, Java is most popular programming language according to some rankings);
  • good integration with IDEs and build tools like Ant, Gradle or Maven;
  • actively maintained project;
  • easy to use and extend;

There are some solutions for this, like:

  • reflection
  • AspectJ
  • Annotation Processing Tool
  • bytecode manipulation (CGLIB, Javassist, java.lang.instrument)
  • Eclipse JDT
  • Project Lombok
  • Groovy, JRuby, Scala

But unfortunately none of them meets all the criteria above. Is there any complete metaprogramming solution for Java?

Edit
Report