Search code examples
javaannotationsjavac

What is annotation processing in Java?


Quoting, Sun's Official Java Tutorial

Class names, 'HelloWorldApp', are only accepted if annotation processing is explicitly requested

What does it mean? And how to apply it?


Solution

  • "Annotation Processing" is a hook into the compile process of the java compiler, to analyse the source code for user defined annotations and handle then (by producing compiler errors, compiler warning, emitting source code, byte code ...).

    API reference: javax.annotation.processing (Java Platform SE 6).