public abstract class AbstractProcessor extends JavaxLangModelUtilities implements Processor, JavaLangReflectMethods
Processor
by providing a
getSupportedSourceVersion()
implementation, methods to report
Diagnostic.Kind.ERROR
s and
Diagnostic.Kind.WARNING
s, and access to
ProcessingEnvironment.getFiler()
,
ProcessingEnvironment.getElementUtils()
, and
ProcessingEnvironment.getTypeUtils()
.
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 |
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractProcessor.Check<T extends Element>
Abstract
AbstractProcessor.Check base class. |
protected class |
AbstractProcessor.Criterion<T extends Element>
Abstract
AbstractProcessor.Criterion base class. |
Modifier and Type | Field and Description |
---|---|
protected Filer |
filer
|
protected JavacTask |
javac
|
elements, fm, MODIFIERS, types
Constructor and Description |
---|
AbstractProcessor() |
Modifier and Type | Method and 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,
Element element,
AnnotationMirror annotation,
AnnotationValue value,
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,
String format,
Object... argv)
Method to print a diagnostic message.
|
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 a
Throwable . |
abstract boolean |
process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) |
protected void |
whenAnnotationProcessingFinished()
Callback method to signal
TaskEvent.Kind.ANNOTATION_PROCESSING is
finished. |
asClass, asExecutableElement, asExecutableElement, asPackageInfoClass, asTypeElement, asTypeMirror, asTypeMirrorList, asVariableElement, getAnnotationMirror, getAnnotationMirror, getAnnotationValue, getClassLoader, getClassPathClassLoader, getClassPathClassLoader, getConstructor, getEnclosingTypeElement, getMethod, getMethod, getPropertyName, getPropertyNames, getTypeElementFor, hasSameSignatureAs, hasSameSignatureAs, hasSameSignatureAs, implementationOf, isAssignableTo, isAssignableTo, isAssignableTo, isAssignableTo, isEmptyArray, isGetterMethod, named, overrides, overrides, signature, signature, specifiedBy, toEnumSet, toModifiers, with, withModifiers, withModifiers, without, withoutModifiers, withoutModifiers, withParameters, withParameters
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 AbstractProcessor()
public Set<String> getSupportedOptions()
getSupportedOptions
in interface Processor
public abstract Set<String> getSupportedAnnotationTypes()
getSupportedAnnotationTypes
in interface Processor
public SourceVersion getSupportedSourceVersion()
getSupportedSourceVersion
in interface Processor
public void init(ProcessingEnvironment processingEnv)
public abstract boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
public Iterable<? extends Completion> getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String text)
getCompletions
in interface Processor
protected void whenAnnotationProcessingFinished()
TaskEvent.Kind.ANNOTATION_PROCESSING
is
finished.protected void print(Diagnostic.Kind kind, String format, Object... argv)
kind
- The Diagnostic.Kind
.format
- The message format String
.argv
- Optional arguments to the message format
String
.Messager.printMessage(Diagnostic.Kind,CharSequence)
protected void print(Diagnostic.Kind kind, Element element, String format, Object... argv)
kind
- The Diagnostic.Kind
.element
- The offending Element
.format
- The message format String
.argv
- Optional arguments to the message format
String
.Messager.printMessage(Diagnostic.Kind,CharSequence,Element)
protected void print(Diagnostic.Kind kind, Element element, AnnotationMirror annotation, String format, Object... argv)
kind
- The Diagnostic.Kind
.element
- The offending Element
.annotation
- The offending AnnotationMirror
.format
- The message format String
.argv
- Optional arguments to the message format
String
.Messager.printMessage(Diagnostic.Kind,CharSequence,Element,AnnotationMirror)
protected void print(Diagnostic.Kind kind, Element element, AnnotationMirror annotation, AnnotationValue value, String format, Object... argv)
kind
- The Diagnostic.Kind
.element
- The offending Element
.annotation
- The offending AnnotationMirror
.value
- The offending AnnotationValue
.format
- The message format String
.argv
- Optional arguments to the message format
String
.Messager.printMessage(Diagnostic.Kind,CharSequence,Element,AnnotationMirror,AnnotationValue)
protected void print(Diagnostic.Kind kind, Throwable throwable)
Throwable
.kind
- The Diagnostic.Kind
.throwable
- The Throwable
.Copyright © 2015–2021. All rights reserved.