java.lang.Object
javax.annotation.processing.AbstractProcessor
- All Implemented Interfaces:
- Processor
An abstract annotation processor designed to be a convenient
 superclass for most concrete annotation processors.  This class
 examines annotation values to compute the options, annotation interfaces, and
 source version supported by
 its subtypes.
 
The getter methods may issue warnings about noteworthy conditions using the facilities available after the processor has been initialized.
Subclasses are free to override the implementation and
 specification of any of the methods in this class as long as the
 general Processor
 contract for that method is obeyed.
- Since:
- 1.6
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ProcessingEnvironmentProcessing environment providing by the tool framework.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionIterable<? extends Completion>getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText) Returns an empty iterable of completions.If the processor class is annotated withSupportedAnnotationTypes, return an unmodifiable set with the same set of strings as the annotation.If the processor class is annotated withSupportedOptions, return an unmodifiable set with the same set of strings as the annotation.If the processor class is annotated withSupportedSourceVersion, return the source version in the annotation.voidinit(ProcessingEnvironment processingEnv) Initializes the processor with the processing environment by setting theprocessingEnvfield to the value of theprocessingEnvargument.protected boolean
- 
Field Details- 
processingEnvProcessing environment providing by the tool framework.
 
- 
- 
Constructor Details- 
AbstractProcessorprotected AbstractProcessor()Constructor for subclasses to call.
 
- 
- 
Method Details- 
getSupportedOptionsIf the processor class is annotated withSupportedOptions, return an unmodifiable set with the same set of strings as the annotation. If the class is not so annotated, an empty set is returned.- Specified by:
- getSupportedOptionsin interface- Processor
- Returns:
- the options recognized by this processor, or an empty set if none
- See Also:
 
- 
getSupportedAnnotationTypesIf the processor class is annotated withSupportedAnnotationTypes, return an unmodifiable set with the same set of strings as the annotation. If the class is not so annotated, an empty set is returned. If the source version does not support modules, in other words if it is less than or equal toRELEASE_8, then any leading module prefixes are stripped from the names.- Specified by:
- getSupportedAnnotationTypesin interface- Processor
- Returns:
- the names of the annotation interfaces supported by this processor, or an empty set if none
- See Also:
 
- 
getSupportedSourceVersionIf the processor class is annotated withSupportedSourceVersion, return the source version in the annotation. If the class is not so annotated,SourceVersion.RELEASE_6is returned.- Specified by:
- getSupportedSourceVersionin interface- Processor
- Returns:
- the latest source version supported by this processor
- See Also:
 
- 
initInitializes the processor with the processing environment by setting theprocessingEnvfield to the value of theprocessingEnvargument. AnIllegalStateExceptionwill be thrown if this method is called more than once on the same object.- Specified by:
- initin interface- Processor
- Parameters:
- processingEnv- environment to access facilities the tool framework provides to the processor
- Throws:
- IllegalStateException- if this method is called more than once.
 
- 
getCompletionspublic Iterable<? extends Completion> getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText) Returns an empty iterable of completions.- Specified by:
- getCompletionsin interface- Processor
- Parameters:
- element- the element being annotated
- annotation- the (perhaps partial) annotation being applied to the element
- member- the annotation member to return possible completions for
- userText- source code text to be completed
- Returns:
- an empty iterable of completions
 
- 
isInitializedprotected boolean isInitialized()- Returns:
- trueif this object has been initialized,- falseotherwise
 
 
-