Package ball.annotation.processing
Class AbstractProcessor
- java.lang.Object
-
- ball.annotation.processing.JavaxLangModelUtilities
-
- ball.annotation.processing.AbstractProcessor
-
- All Implemented Interfaces:
JavaLangReflectMethods,Processor
- Direct Known Subclasses:
AnnotatedNoAnnotationProcessor,AnnotatedProcessor,NoopProcessor
public abstract class AbstractProcessor extends JavaxLangModelUtilities implements Processor, JavaLangReflectMethods
Provides abstract base class forProcessorby providing agetSupportedSourceVersion()implementation, methods to reportDiagnostic.Kind.ERRORs andDiagnostic.Kind.WARNINGs, and access toProcessingEnvironment.getFiler(),ProcessingEnvironment.getElementUtils(), andProcessingEnvironment.getTypeUtils().Bean Property Summary
Name Mode Type isHidden isBound isConstrained supportedAnnotationTypes R Set<String>false false false supportedOptions R Set<String>false false false supportedSourceVersion R SourceVersionfalse false false - Author:
- Allen D. Ball
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAbstractProcessor.Check<T extends Element>AbstractAbstractProcessor.Checkbase class.protected classAbstractProcessor.Criterion<T extends Element>AbstractAbstractProcessor.Criterionbase class.
-
Constructor Summary
Constructors Constructor Description AbstractProcessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Iterable<? extends Completion>getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String text)abstract Set<String>getSupportedAnnotationTypes()Set<String>getSupportedOptions()SourceVersiongetSupportedSourceVersion()voidinit(ProcessingEnvironment processingEnv)protected voidprint(Diagnostic.Kind kind, String format, Object... argv)Method to print a diagnostic message.protected voidprint(Diagnostic.Kind kind, Throwable throwable)Method to print aThrowable.protected voidprint(Diagnostic.Kind kind, Element element, String format, Object... argv)Method to print a diagnostic message.protected voidprint(Diagnostic.Kind kind, Element element, AnnotationMirror annotation, String format, Object... argv)Method to print a diagnostic message.protected voidprint(Diagnostic.Kind kind, Element element, AnnotationMirror annotation, AnnotationValue value, String format, Object... argv)Method to print a diagnostic message.abstract booleanprocess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)protected voidwhenAnnotationProcessingFinished()Callback method to signalTaskEvent.Kind.ANNOTATION_PROCESSINGis finished.-
Methods inherited from class ball.annotation.processing.JavaxLangModelUtilities
asClass, asExecutableElement, asExecutableElement, asPackageInfoClass, asTypeElement, asTypeMirror, asTypeMirrorList, asVariableElement, getAnnotationMirror, getAnnotationMirror, getAnnotationValue, getClassLoader, getClassPathClassLoader, getClassPathClassLoader, getConstructor, getEnclosingTypeElement, getMethod, getPropertyName, getPropertyNames, getTypeElementFor, hasSameSignatureAs, hasSameSignatureAs, hasSameSignatureAs, implementationOf, isAssignableTo, isAssignableTo, isAssignableTo, isAssignableTo, isEmptyArray, isGenerated, isGetterMethod, named, overrides, overrides, signature, signature, specifiedBy, toEnumSet, toModifiers, with, withModifiers, withModifiers, without, withoutModifiers, withoutModifiers, withParameters, withParameters
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ball.lang.reflect.JavaLangReflectMethods
asModifierSet, declaration, declaration, declaration, declaration, declaration, declaration, declaration, declaration, exceptions, getModifiers, getModifiers, modifiers, parameters, type, type
-
-
-
-
Constructor Detail
-
AbstractProcessor
public AbstractProcessor()
-
-
Method Detail
-
getSupportedOptions
public Set<String> getSupportedOptions()
- Specified by:
getSupportedOptionsin interfaceProcessor
-
getSupportedAnnotationTypes
public abstract Set<String> getSupportedAnnotationTypes()
- Specified by:
getSupportedAnnotationTypesin interfaceProcessor
-
getSupportedSourceVersion
public SourceVersion getSupportedSourceVersion()
- Specified by:
getSupportedSourceVersionin interfaceProcessor
-
init
public void init(ProcessingEnvironment processingEnv)
-
process
public abstract boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
-
getCompletions
public Iterable<? extends Completion> getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String text)
- Specified by:
getCompletionsin interfaceProcessor
-
whenAnnotationProcessingFinished
protected void whenAnnotationProcessingFinished()
Callback method to signalTaskEvent.Kind.ANNOTATION_PROCESSINGis finished.
-
print
protected void print(Diagnostic.Kind kind, String format, Object... argv)
Method to print a diagnostic message.- Parameters:
kind- TheDiagnostic.Kind.format- The message formatString.argv- Optional arguments to the message formatString.- See Also:
Messager.printMessage(Diagnostic.Kind,CharSequence)
-
print
protected void print(Diagnostic.Kind kind, Element element, String format, Object... argv)
Method to print a diagnostic message.- Parameters:
kind- TheDiagnostic.Kind.element- The offendingElement.format- The message formatString.argv- Optional arguments to the message formatString.- See Also:
Messager.printMessage(Diagnostic.Kind,CharSequence,Element)
-
print
protected void print(Diagnostic.Kind kind, Element element, AnnotationMirror annotation, String format, Object... argv)
Method to print a diagnostic message.- Parameters:
kind- TheDiagnostic.Kind.element- The offendingElement.annotation- The offendingAnnotationMirror.format- The message formatString.argv- Optional arguments to the message formatString.- See Also:
Messager.printMessage(Diagnostic.Kind,CharSequence,Element,AnnotationMirror)
-
print
protected void print(Diagnostic.Kind kind, Element element, AnnotationMirror annotation, AnnotationValue value, String format, Object... argv)
Method to print a diagnostic message.- Parameters:
kind- TheDiagnostic.Kind.element- The offendingElement.annotation- The offendingAnnotationMirror.value- The offendingAnnotationValue.format- The message formatString.argv- Optional arguments to the message formatString.- See Also:
Messager.printMessage(Diagnostic.Kind,CharSequence,Element,AnnotationMirror,AnnotationValue)
-
print
protected void print(Diagnostic.Kind kind, Throwable throwable)
Method to print aThrowable.- Parameters:
kind- TheDiagnostic.Kind.throwable- TheThrowable.
-
-