Java Reference
In-Depth Information
another for processors. But whatever your option, do not forget to define the service
in the META-INF/services project directory that contains the processor.
The following screenshot shows the contents of the file
javax.annotation.processing.Processor . As the package contains only a
single processor, then it is obvious that we will have a single line in this file as shown
in the following screenshot:
For those using Maven v2.3.2 , to achieve the project that contains the processors,
they must set the option <compilerArgument>-
proc:none</compilerArgument> in the configuration of the plugin maven-
compiler-plugin so that the code is properly compiled.
Now you can import the package that contains the annotation in another project and
use it at your convenience. When compiling our preceding App class, we have the
following result:
***** Class :com.packt.ch07.App, Annotated
element : size, Kind : FIELD, Message : Make
sure that this element is not null****
***** Class :com.packt.ch07.App, Annotated
element : main, Kind : METHOD, Message :
Nothing has been done****
Search WWH ::

Custom Search