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, isInitialized
public void init(ProcessingEnvironment env)
init
in interface Processor
init
in class AbstractProcessor
public final boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
process
in interface Processor
process
in class AbstractProcessor
protected 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.Exception
protected final void writeCode(String packageName, String className, StringBuffer code) throws IOException
IOException
Copyright © 2012–2018 JBoss by Red Hat. All rights reserved.