@SupportedOptions(value={"micronaut.processing.incremental","micronaut.processing.annotations","micronaut.processing.project.dir","micronaut.processing.group","micronaut.processing.module"}) public class TypeElementVisitorProcessor extends AbstractProcessor
The annotation processed used to execute type element visitors.
Modifier and Type | Field and Description |
---|---|
protected AnnotationUtils |
annotationUtils |
protected AnnotationProcessingOutputVisitor |
classWriterOutputVisitor |
protected Elements |
elementUtils |
protected Filer |
filer |
protected GenericUtils |
genericUtils |
protected static String |
GRADLE_PROCESSING_AGGREGATING
Constant for aggregating processor.
|
protected static String |
GRADLE_PROCESSING_ISOLATING
Constant for isolating processor.
|
protected JavaVisitorContext |
javaVisitorContext |
protected Messager |
messager |
protected static String |
MICRONAUT_PROCESSING_ANNOTATIONS
Annotation processor option used to add additional annotation patterns to process.
|
protected static String |
MICRONAUT_PROCESSING_INCREMENTAL
Annotation processor option used to activate incremental processing.
|
protected ModelUtils |
modelUtils |
protected Types |
typeUtils |
protected MutableConvertibleValues<Object> |
visitorAttributes |
processingEnv
Constructor and Description |
---|
TypeElementVisitorProcessor() |
Modifier and Type | Method and Description |
---|---|
protected void |
error(Element e,
String msg,
Object... args)
Produce a compile error for the given element and message.
|
protected void |
error(String msg,
Object... args)
Produce a compile error for the given message.
|
protected Collection<TypeElementVisitor> |
findTypeElementVisitors()
Discovers the
TypeElementVisitor instances that are available. |
protected TypeElementVisitor.VisitorKind |
getIncrementalProcessorKind() |
protected String |
getIncrementalProcessorType() |
protected List<LoadedVisitor> |
getLoadedVisitors() |
Set<String> |
getSupportedAnnotationTypes() |
Set<String> |
getSupportedOptions() |
SourceVersion |
getSupportedSourceVersion() |
protected TypeElementVisitor.VisitorKind |
getVisitorKind()
obtains the visitor kind.
|
void |
init(ProcessingEnvironment processingEnv) |
protected boolean |
isIncremental(ProcessingEnvironment processingEnv)
Whether incremental compilation is enabled.
|
protected boolean |
isProcessedAnnotation(String annotationName)
Return whether the given annotation is processed.
|
protected JavaVisitorContext |
newVisitorContext(ProcessingEnvironment processingEnv)
Creates the visitor context.
|
protected void |
note(Element e,
String msg,
Object... args)
Produce a compile note for the given element and message.
|
protected void |
note(String msg,
Object... args)
Produce a compile note for the given element and message.
|
boolean |
process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) |
protected void |
warning(Element e,
String msg,
Object... args)
Produce a compile warning for the given element and message.
|
protected void |
warning(String msg,
Object... args)
Produce a compile warning for the given message.
|
getCompletions, isInitialized
protected static final String MICRONAUT_PROCESSING_INCREMENTAL
protected static final String MICRONAUT_PROCESSING_ANNOTATIONS
protected static final String GRADLE_PROCESSING_AGGREGATING
protected static final String GRADLE_PROCESSING_ISOLATING
protected Messager messager
protected Filer filer
protected Elements elementUtils
protected Types typeUtils
protected AnnotationUtils annotationUtils
protected GenericUtils genericUtils
protected ModelUtils modelUtils
protected MutableConvertibleValues<Object> visitorAttributes
protected AnnotationProcessingOutputVisitor classWriterOutputVisitor
protected JavaVisitorContext javaVisitorContext
public void init(ProcessingEnvironment processingEnv)
protected List<LoadedVisitor> getLoadedVisitors()
protected TypeElementVisitor.VisitorKind getIncrementalProcessorKind()
GRADLE_PROCESSING_AGGREGATING
,
GRADLE_PROCESSING_ISOLATING
public Set<String> getSupportedAnnotationTypes()
getSupportedAnnotationTypes
in interface Processor
public Set<String> getSupportedOptions()
getSupportedOptions
in interface Processor
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
process
in interface Processor
process
in class AbstractProcessor
@NonNull protected Collection<TypeElementVisitor> findTypeElementVisitors()
TypeElementVisitor
instances that are available.public SourceVersion getSupportedSourceVersion()
getSupportedSourceVersion
in interface Processor
getSupportedSourceVersion
in class AbstractProcessor
protected String getIncrementalProcessorType()
GRADLE_PROCESSING_AGGREGATING
,
GRADLE_PROCESSING_ISOLATING
protected boolean isProcessedAnnotation(String annotationName)
annotationName
- The annotation name@NonNull protected JavaVisitorContext newVisitorContext(@NonNull ProcessingEnvironment processingEnv)
processingEnv
- The processing env@NonNull protected TypeElementVisitor.VisitorKind getVisitorKind()
protected final void error(Element e, String msg, Object... args)
e
- The elementmsg
- The messageargs
- The string format argsprotected final void error(String msg, Object... args)
msg
- The messageargs
- The string format argsprotected final void warning(Element e, String msg, Object... args)
e
- The elementmsg
- The messageargs
- The string format argsprotected final void warning(String msg, Object... args)
msg
- The messageargs
- The string format argsprotected final void note(Element e, String msg, Object... args)
e
- The elementmsg
- The messageargs
- The string format argsprotected final void note(String msg, Object... args)
msg
- The messageargs
- The string format argsprotected boolean isIncremental(@NonNull ProcessingEnvironment processingEnv)
processingEnv
- The processing environment.