Klasse BaseAnnotationProcessorManager
- Alle implementierten Schnittstellen:
IProcessorProvider
- Bekannte direkte Unterklassen:
BatchAnnotationProcessorManager
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.-
Feldübersicht
Modifizierer und TypFeldBeschreibungprotected PrintWriter
boolean
protected PrintWriter
protected boolean
protected boolean
protected BaseProcessingEnvImpl
protected List<ProcessorInfo>
The list of processors that have been loaded so far.protected int
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Configure the receiver using the given batch compiler and the given options.void
configureFromPlatform
(Compiler compiler, Object compilationUnitLocator, Object javaProject, boolean isTestCode) Configure the receiver using the given compiler, the given compilationUnitLocator and the given java project.Returns the deleted units.Return the new binary bindings created in the last round.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 inProcessor
.void
reset()
Reinitialize the receivervoid
setErr
(PrintWriter err) Set the print writer for the standard error.void
setOut
(PrintWriter out) Set the print writer for the standard output.void
setProcessors
(Object[] processors) Set the processors for annotation processing.Von Klasse geerbte Methoden org.aspectj.org.eclipse.jdt.internal.compiler.AbstractAnnotationProcessorManager
cleanUp, closeClassLoader
Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Von Schnittstelle geerbte Methoden org.aspectj.org.eclipse.jdt.internal.compiler.apt.dispatch.IProcessorProvider
discoverNextProcessor, reportProcessorException
-
Felddetails
-
_out
-
_err
-
_processingEnv
-
_isFirstRound
public boolean _isFirstRound -
_processors
The list of processors that have been loaded so far. A processor on this list has been initialized, but may not yet have been called to process(). -
_printProcessorInfo
protected boolean _printProcessorInfo -
_printRounds
protected boolean _printRounds -
_round
protected int _round
-
-
Konstruktordetails
-
BaseAnnotationProcessorManager
public BaseAnnotationProcessorManager()
-
-
Methodendetails
-
configure
Beschreibung aus Klasse kopiert:AbstractAnnotationProcessorManager
Configure the receiver using the given batch compiler and the given options. The parameter batchCompiler is expected to be an instance of the batch compiler. This method is only used for the batch mode. For the IDE mode, please seeAbstractAnnotationProcessorManager.configureFromPlatform(Compiler, Object, Object, boolean)
.- Angegeben von:
configure
in KlasseAbstractAnnotationProcessorManager
- Parameter:
batchCompiler
- the given batch compiler objectoptions
- the given options
-
configureFromPlatform
public void configureFromPlatform(Compiler compiler, Object compilationUnitLocator, Object javaProject, boolean isTestCode) Beschreibung aus Klasse kopiert:AbstractAnnotationProcessorManager
Configure the receiver using the given compiler, the given compilationUnitLocator and the given java project.- Angegeben von:
configureFromPlatform
in KlasseAbstractAnnotationProcessorManager
- Parameter:
compiler
- the given compilercompilationUnitLocator
- the given compilation unit locatorjavaProject
- the given java project
-
getDiscoveredProcessors
- Angegeben von:
getDiscoveredProcessors
in SchnittstelleIProcessorProvider
- Gibt zurück:
- the list of all processors that have been discovered so far. This list will grow when
IProcessorProvider.discoverNextProcessor()
is called.
-
getDeletedUnits
Beschreibung aus Klasse kopiert:AbstractAnnotationProcessorManager
Returns the deleted units.- Angegeben von:
getDeletedUnits
in KlasseAbstractAnnotationProcessorManager
- Gibt zurück:
- the deleted units
-
getNewUnits
Beschreibung aus Klasse kopiert:AbstractAnnotationProcessorManager
Return the new units created in the last round.- Angegeben von:
getNewUnits
in KlasseAbstractAnnotationProcessorManager
- Gibt zurück:
- the new units created in the last round
-
getNewClassFiles
Beschreibung aus Klasse kopiert:AbstractAnnotationProcessorManager
Return the new binary bindings created in the last round.- Angegeben von:
getNewClassFiles
in KlasseAbstractAnnotationProcessorManager
- Gibt zurück:
- the new binary bindings created in the last round
-
reset
public void reset()Beschreibung aus Klasse kopiert:AbstractAnnotationProcessorManager
Reinitialize the receiver- Angegeben von:
reset
in KlasseAbstractAnnotationProcessorManager
-
setErr
Beschreibung aus Klasse kopiert:AbstractAnnotationProcessorManager
Set the print writer for the standard error.- Angegeben von:
setErr
in KlasseAbstractAnnotationProcessorManager
- Parameter:
err
- the given print writer for error
-
setOut
Beschreibung aus Klasse kopiert:AbstractAnnotationProcessorManager
Set the print writer for the standard output.- Angegeben von:
setOut
in KlasseAbstractAnnotationProcessorManager
- Parameter:
out
- the given print writer for output
-
setProcessors
Beschreibung aus Klasse kopiert:AbstractAnnotationProcessorManager
Set the processors for annotation processing.- Angegeben von:
setProcessors
in KlasseAbstractAnnotationProcessorManager
- Parameter:
processors
- the given processors
-
processAnnotations
public void processAnnotations(CompilationUnitDeclaration[] units, ReferenceBinding[] referenceBindings, boolean isLastRound) A single "round" of processing, in the sense implied inProcessor
.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.- Angegeben von:
processAnnotations
in KlasseAbstractAnnotationProcessorManager
- Parameter:
units
- the given source typereferenceBindings
- the given binary typesisLastRound
- flag to notify the last round
-