public abstract class AbstractMetaProcessor<T extends Annotation> extends XAbstractProcessor
XAbstractProcessor.Assert<T>, XAbstractProcessor.LogCommonUtil.ActionE0<E extends Exception>, CommonUtil.FuncE0<R,E extends Exception>| Modifier and Type | Field and Description |
|---|---|
protected Class<T> |
metaClass |
protected NestCompileFile |
metaFile |
protected Set<TypeElement> |
nestMetaAnnotations |
elements, filer, isDebug, messager, typesprocessingEnv| Constructor and Description |
|---|
AbstractMetaProcessor() |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getSupportedAnnotationTypes()
If the processor class is annotated with
SupportedAnnotation or
SupportedAnnotationTypes, return an unmodifiable set with the same
set of strings as the annotation. |
protected TypeElement |
handleMetaFor(TypeElement origin) |
void |
init(ProcessingEnvironment processingEnv) |
protected String |
metaPath(Class<?> metaClass) |
protected abstract void |
process(RoundEnvironment env,
T t,
AnnotationMirror mid,
Element element) |
boolean |
processActual(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv)
Processes a set of annotation types on type elements originating from the
prior round and returns whether or not these annotation types are claimed
by this processor.
|
protected void |
processMeta(RoundEnvironment env,
T t,
Element element) |
protected void |
writeMetaClasses(List<TypeElement> annotatedAnnotations) |
assertDo, assertDo, assertNonNull, assertThat, assertThat, assertThat, assertType, debug, error, handleAssert, process, warninggetCompletions, getSupportedOptions, getSupportedSourceVersion, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitensureFileSystem, getStackTraceString, throwAsUncheck, uncatch, uncatch, uncheck, uncheckprotected Class<T extends Annotation> metaClass
protected NestCompileFile metaFile
protected Set<TypeElement> nestMetaAnnotations
public void init(ProcessingEnvironment processingEnv)
XAbstractProcessorinit in interface Processorinit in class XAbstractProcessorpublic boolean processActual(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws AssertException
XAbstractProcessortrue is returned, the annotation types are claimed and subsequent
processors will not be asked to process them; if false is returned,
the annotation types are unclaimed and subsequent processors may be asked
to process them. A processor may always return the same boolean value or
may vary the result based on chosen criteria.
The input set will be empty if the processor supports "*" and the root elements have no annotations. A Processor must gracefully handle an empty set of annotations.
processActual in class XAbstractProcessorannotations - the annotation types requested to be processedroundEnv - environment for information about the current and prior
roundAssertException - throw the AssertException to quit the process
directlyXAbstractProcessor.assertThat(boolean),
XAbstractProcessor.handleAssert(Runnable)protected void writeMetaClasses(List<TypeElement> annotatedAnnotations) throws Error
Errorprotected TypeElement handleMetaFor(TypeElement origin)
protected void processMeta(RoundEnvironment env, T t, Element element) throws AssertException
AssertExceptionprotected abstract void process(RoundEnvironment env, T t, AnnotationMirror mid, Element element) throws AssertException
AssertExceptionpublic Set<String> getSupportedAnnotationTypes()
XAbstractProcessorSupportedAnnotation or
SupportedAnnotationTypes, 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.getSupportedAnnotationTypes in interface ProcessorgetSupportedAnnotationTypes in class XAbstractProcessorCopyright © 2018. All rights reserved.