public abstract class AnnotatedProcessor extends AbstractProcessor
Processor
base class for
processing Annotation
s specified by @For
. Provides
built-in support for a number of Annotation
types.AnnotationValueMustConvertTo
,
TargetMustBe
,
TargetMustExtend
,
TargetMustHaveConstructor
,
TargetMustHaveModifiers
,
TargetMustNotHaveModifiers
AbstractProcessor.Check<T extends Element>, AbstractProcessor.Criterion<T extends Element>
elements, filer, fm, javac, trees, types
processingEnv
Constructor and Description |
---|
AnnotatedProcessor() |
Modifier and Type | Method and Description |
---|---|
protected List<Class<? extends Annotation>> |
getSupportedAnnotationTypeList()
|
Set<String> |
getSupportedAnnotationTypes() |
void |
init(ProcessingEnvironment processingEnv) |
protected void |
process(RoundEnvironment roundEnv,
TypeElement annotation,
Element element)
Callback method to process an annotated
Element . |
boolean |
process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) |
asTypeElement, asTypeMirror, asTypeMirrorList, getAnnotationMirror, getAnnotationMirror, getAnnotationValue, getClassPathClassLoader, getConstructor, getMethod, getMethod, getPropertyName, getPropertyNames, getSupportedSourceVersion, hasSameSignatureAs, hasSameSignatureAs, hasSameSignatureAs, implementationOf, isAssignableTo, isAssignableTo, isAssignableTo, isAssignableTo, isEmptyArray, isGetterMethod, named, overrides, overrides, print, print, print, print, print, specifiedBy, toEnumSet, whenAnnotationProcessingFinished, with, withModifiers, withModifiers, without, withoutModifiers, withoutModifiers, withParameters, withParameters
getCompletions, getSupportedOptions, isInitialized
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asModifierSet, declaration, declaration, declaration, declaration, declaration, declaration, exceptions, getModifiers, getModifiers, modifiers, parameters, type, type
public AnnotatedProcessor()
protected List<Class<? extends Annotation>> getSupportedAnnotationTypeList()
List
of supported Annotation
Class
es.public Set<String> getSupportedAnnotationTypes()
getSupportedAnnotationTypes
in interface Processor
getSupportedAnnotationTypes
in class AbstractProcessor
public void init(ProcessingEnvironment processingEnv)
init
in interface Processor
init
in class AbstractProcessor
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
process
in interface Processor
process
in class AbstractProcessor
protected void process(RoundEnvironment roundEnv, TypeElement annotation, Element element)
Element
. Default
implementation does nothing.roundEnv
- The RoundEnvironment
.annotation
- The annotation TypeElement
.element
- The annotated Element
.Copyright © 2015–2020 Allen D. Ball. All rights reserved.