Java News from Sunday, July 10, 2005

Sun has posted the early draft review of JSR-269, Pluggable Annotation Processing API to the Java Community Process (JCP). The spec at thsi point is pure JavaDoc. and I really wish they'd just put it up on a web site instead of making it a downloadable zip file. According to the JSR,

J2SE 1.5 added a new Java language mechanism "annotations" that allows annotation types to be used to annotate classes, fields, and methods. These annotations are typically processed either by build-time tools or by run-time libraries to achieve new semantic effects. In order to support annotation processing at build-time, this JSR will define APIs to allow annotation processors to be created using a standard pluggable API. This will simplify the task of creating annotation processors and will also allow automation of the discovery of appropriate annotation processors for a given source file.

The specification will include at least two sections, a section of API modeling the Java programming language and a distinct section for declaring annotation processors and controlling how they are run. Since annotations are placed on program elements, an annotation processing framework needs to reflect program structure. Annotation processors will be able to specify what annotations they process and multiple processors will be able to run cooperatively.

The processors and program structure api can be accessed at build-time; i.e. this functionality supplements core reflection support for reading annotations.

Comments are due by August 1.