Package org.antlr.v4.test.runtime
Class CommentHasStringValueProcessor
- java.lang.Object
-
- javax.annotation.processing.AbstractProcessor
-
- org.antlr.v4.test.runtime.CommentHasStringValueProcessor
-
- All Implemented Interfaces:
javax.annotation.processing.Processor
@SupportedAnnotationTypes("org.antlr.v4.test.runtime.CommentHasStringValue") @SupportedSourceVersion(RELEASE_7) public class CommentHasStringValueProcessor extends javax.annotation.processing.AbstractProcessor
I think I figured out how to use annotation processors in maven. It's more or less automatic and you don't even need to tell maven, with one minor exception. The idea is to create a project for the annotation and another for the annotation processor. Then, a project that uses the annotation can simply set up the dependency on the other projects. You have to turn off processing, -proc:none on the processor project itself but other than that, java 6+ more or less tries to apply any processors it finds during compilation. maven just works. Also you need a META-INF/services/javax.annotation.processing.Processor file with "org.antlr.v4.test.runtime.CommentHasStringValueProcessor" in it.
-
-
Constructor Summary
Constructors Constructor Description CommentHasStringValueProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.lang.model.SourceVersion
getSupportedSourceVersion()
void
init(javax.annotation.processing.ProcessingEnvironment processingEnv)
boolean
process(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)
-
-
-
Method Detail
-
init
public void init(javax.annotation.processing.ProcessingEnvironment processingEnv)
- Specified by:
init
in interfacejavax.annotation.processing.Processor
- Overrides:
init
in classjavax.annotation.processing.AbstractProcessor
-
process
public boolean process(java.util.Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)
- Specified by:
process
in interfacejavax.annotation.processing.Processor
- Specified by:
process
in classjavax.annotation.processing.AbstractProcessor
-
getSupportedSourceVersion
public javax.lang.model.SourceVersion getSupportedSourceVersion()
- Specified by:
getSupportedSourceVersion
in interfacejavax.annotation.processing.Processor
- Overrides:
getSupportedSourceVersion
in classjavax.annotation.processing.AbstractProcessor
-
-