The annotation spec (JSR-175) describes a method of embedding annotations in Java source code and ways of accessing that data from bytecode or at run-time.
As of Java 1.5.0b2, a new tool has been included with Java called apt , which is a tool to auto-generate files (Java source code as well as other build artifacts) using annotations. This is very much in line with XDoclet. Although apt wasn't available at the time I wrote this article, my goal was very similar to apt's. However, I extended this concept to include not only compile-time build processes, but modification of bytecode while it is running.