Java Annotation Processor: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 19: Line 19:


http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/javac.html#processing
http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/javac.html#processing
API for processors: javax.annotation.processing, javax.lang.model.

Revision as of 07:13, 1 November 2018

External

Internal

Overview

The Pluggable Annotation Processing API is specified by JSR 269 and can be used to develop custom annotation processors. Annotation processing is actively used in many Java libraries, for instance to generate metaclasses in JPA or to augment classes with boilerplate code in Lombok library.

The processing API can only be used to generate new files, not change the existing ones. Lombok is an exception.

TODO

META-INF/services/javax.annotation.processing.Processor

http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/javac.html#processing

API for processors: javax.annotation.processing, javax.lang.model.