public abstract class AbstractErrorAbsorbingProcessor extends AbstractProcessor
processingEnv| Modifier | Constructor and Description |
|---|---|
protected |
AbstractErrorAbsorbingProcessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
init(ProcessingEnvironment env)
Wraps the given processing environment with one that protects against known bugs in the Eclipse annotation
processing implementation.
|
boolean |
process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) |
protected abstract boolean |
processWithExceptions(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv)
Same contract as
process(Set, RoundEnvironment), except that any
exceptions thrown are caught and printed as messages of type
Diagnostic.Kind.ERROR. |
protected void |
rememberInitializationError(Throwable t)
Subclasses must call this from their constructors if something throws an
exception during initialization of the instance.
|
protected void |
writeCode(String packageName,
String className,
StringBuffer code)
Writes the given code to javac's Filer.
|
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, isInitializedpublic void init(ProcessingEnvironment env)
init in interface Processorinit in class AbstractProcessorpublic final boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
process in interface Processorprocess in class AbstractProcessorprotected void rememberInitializationError(Throwable t)
processWithExceptions(Set, RoundEnvironment) method will not be
called on this instance.t - the exception that occurred (and was caught) during instance
creation of this annotation processor instance.protected abstract boolean processWithExceptions(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws Exception
process(Set, RoundEnvironment), except that any
exceptions thrown are caught and printed as messages of type
Diagnostic.Kind.ERROR. This is done to keep Eclipse JDT from going into an
infinite processing loop.Exceptionprotected final void writeCode(String packageName, String className, StringBuffer code) throws IOException
IOExceptionCopyright © 2012–2020 JBoss by Red Hat. All rights reserved.