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 forProcessor
by providing agetSupportedSourceVersion()
implementation, methods to reportDiagnostic.Kind.ERROR
s andDiagnostic.Kind.WARNING
s, 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 SourceVersion
false false false - Author:
- Allen D. Ball
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractProcessor.Check<T extends Element>
AbstractAbstractProcessor.Check
base class.protected class
AbstractProcessor.Criterion<T extends Element>
AbstractAbstractProcessor.Criterion
base 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()
SourceVersion
getSupportedSourceVersion()
void
init(ProcessingEnvironment processingEnv)
protected void
print(Diagnostic.Kind kind, String format, Object... argv)
Method to print a diagnostic message.protected void
print(Diagnostic.Kind kind, Throwable throwable)
Method to print aThrowable
.protected void
print(Diagnostic.Kind kind, Element element, String format, Object... argv)
Method to print a diagnostic message.protected void
print(Diagnostic.Kind kind, Element element, AnnotationMirror annotation, String format, Object... argv)
Method to print a diagnostic message.protected void
print(Diagnostic.Kind kind, Element element, AnnotationMirror annotation, AnnotationValue value, String format, Object... argv)
Method to print a diagnostic message.abstract boolean
process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
protected void
whenAnnotationProcessingFinished()
Callback method to signalTaskEvent.Kind.ANNOTATION_PROCESSING
is 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:
getSupportedOptions
in interfaceProcessor
-
getSupportedAnnotationTypes
public abstract Set<String> getSupportedAnnotationTypes()
- Specified by:
getSupportedAnnotationTypes
in interfaceProcessor
-
getSupportedSourceVersion
public SourceVersion getSupportedSourceVersion()
- Specified by:
getSupportedSourceVersion
in 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:
getCompletions
in interfaceProcessor
-
whenAnnotationProcessingFinished
protected void whenAnnotationProcessingFinished()
Callback method to signalTaskEvent.Kind.ANNOTATION_PROCESSING
is 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
.
-
-