public abstract class BaseAnnotationProcessorManager extends AbstractAnnotationProcessorManager implements IProcessorProvider
RoundDispatcher. There may be multiple instances of this class;
there is in general one of these for every Compiler that has annotation
processing enabled. Within the IDE there will typically be one for every
Java project, because each project potentially has a separate processor path.
TODO: do something useful with _supportedOptions and _supportedAnnotationTypes.| Modifier and Type | Field and Description |
|---|---|
protected java.io.PrintWriter |
_err |
boolean |
_isFirstRound |
protected java.io.PrintWriter |
_out |
protected boolean |
_printProcessorInfo |
protected boolean |
_printRounds |
protected BaseProcessingEnvImpl |
_processingEnv |
protected java.util.List<ProcessorInfo> |
_processors
The list of processors that have been loaded so far.
|
protected int |
_round |
| Constructor and Description |
|---|
BaseAnnotationProcessorManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(java.lang.Object batchCompiler,
java.lang.String[] options)
Configure the receiver using the given batch compiler and the given options.
|
void |
configureFromPlatform(Compiler compiler,
java.lang.Object compilationUnitLocator,
java.lang.Object javaProject,
boolean isTestCode)
Configure the receiver using the given compiler, the given compilationUnitLocator and
the given java project.
|
ICompilationUnit[] |
getDeletedUnits()
Returns the deleted units.
|
java.util.List<ProcessorInfo> |
getDiscoveredProcessors() |
ReferenceBinding[] |
getNewClassFiles()
Return the new binary bindings created in the last round.
|
ICompilationUnit[] |
getNewUnits()
Return the new units created in the last round.
|
void |
processAnnotations(CompilationUnitDeclaration[] units,
ReferenceBinding[] referenceBindings,
boolean isLastRound)
A single "round" of processing, in the sense implied in
Processor. |
void |
reset()
Reinitialize the receiver
|
void |
setErr(java.io.PrintWriter err)
Set the print writer for the standard error.
|
void |
setOut(java.io.PrintWriter out)
Set the print writer for the standard output.
|
void |
setProcessors(java.lang.Object[] processors)
Set the processors for annotation processing.
|
cleanUp, closeClassLoaderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdiscoverNextProcessor, reportProcessorExceptionprotected java.io.PrintWriter _out
protected java.io.PrintWriter _err
protected BaseProcessingEnvImpl _processingEnv
public boolean _isFirstRound
protected java.util.List<ProcessorInfo> _processors
protected boolean _printProcessorInfo
protected boolean _printRounds
protected int _round
public void configure(java.lang.Object batchCompiler,
java.lang.String[] options)
AbstractAnnotationProcessorManagerAbstractAnnotationProcessorManager.configureFromPlatform(Compiler, Object, Object, boolean).configure in class AbstractAnnotationProcessorManagerbatchCompiler - the given batch compiler objectoptions - the given optionspublic void configureFromPlatform(Compiler compiler, java.lang.Object compilationUnitLocator, java.lang.Object javaProject, boolean isTestCode)
AbstractAnnotationProcessorManagerconfigureFromPlatform in class AbstractAnnotationProcessorManagercompiler - the given compilercompilationUnitLocator - the given compilation unit locatorjavaProject - the given java projectpublic java.util.List<ProcessorInfo> getDiscoveredProcessors()
getDiscoveredProcessors in interface IProcessorProviderIProcessorProvider.discoverNextProcessor() is called.public ICompilationUnit[] getDeletedUnits()
AbstractAnnotationProcessorManagergetDeletedUnits in class AbstractAnnotationProcessorManagerpublic ICompilationUnit[] getNewUnits()
AbstractAnnotationProcessorManagergetNewUnits in class AbstractAnnotationProcessorManagerpublic ReferenceBinding[] getNewClassFiles()
AbstractAnnotationProcessorManagergetNewClassFiles in class AbstractAnnotationProcessorManagerpublic void reset()
AbstractAnnotationProcessorManagerreset in class AbstractAnnotationProcessorManagerpublic void setErr(java.io.PrintWriter err)
AbstractAnnotationProcessorManagersetErr in class AbstractAnnotationProcessorManagererr - the given print writer for errorpublic void setOut(java.io.PrintWriter out)
AbstractAnnotationProcessorManagersetOut in class AbstractAnnotationProcessorManagerout - the given print writer for outputpublic void setProcessors(java.lang.Object[] processors)
AbstractAnnotationProcessorManagersetProcessors in class AbstractAnnotationProcessorManagerprocessors - the given processorspublic void processAnnotations(CompilationUnitDeclaration[] units, ReferenceBinding[] referenceBindings, boolean isLastRound)
Processor.
The Java 6 Processor spec contains ambiguities about how processors that support "*" are
handled. Eclipse tries to match Sun's implementation in javac. What that actually does is
analogous to inspecting the set of annotions found in the root units and adding an
"imaginary" annotation if the set is empty. Processors are then called in order of discovery;
for each processor, the intersection between the set of root annotations and the set of
annotations the processor supports is calculated, and if it is non-empty, the processor is
called. If the processor returns true then the intersection (including the
imaginary annotation if one exists) is removed from the set of root annotations and the loop
continues, until the set is empty. Of course, the imaginary annotation is not actually
included in the set of annotations passed in to the processor. A processor's process() method
is not called until its intersection set is non-empty, but thereafter it is called on every
round. Note that even if a processor is not called in the first round, if it is called in
subsequent rounds, it will be called in the order in which the processors were discovered,
rather than being added to the end of the list.
processAnnotations in class AbstractAnnotationProcessorManagerunits - the given source typereferenceBindings - the given binary typesisLastRound - flag to notify the last round