Package spoon.processing
Interface ProcessingManager
- All Superinterfaces:
FactoryAccessor
- All Known Implementing Classes:
QueueProcessingManager,RuntimeProcessingManager
The processing manager defines the API to process a program model of a given
Factory with a set of processors. The program model has
been previously built using a SpoonModelBuilder - see
SpoonModelBuilder.build(). To use, add processors to
the manager, and then call the process method. Also, the method
Processor.processingDone() is up called.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddProcessor(Class<? extends Processor<?>> type) Adds a processor by instantiating its type (a class that must define an empty constructor).voidaddProcessor(String qualifiedName) Adds a processor by instantiating its type (a class that must define an empty constructor and implementProcessor).booleanaddProcessor(Processor<?> p) Adds a processor.Collection<Processor<?>>Gets the processors that have been added to the manager and that will be applied when invoking one of theprocessmethods).voidprocess(Collection<? extends CtElement> elements) Recursively processes a collection ofCtElements with this manager.voidRecursively processes aCtElementwith this manager.Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
Method Details
-
addProcessor
Adds a processor by instantiating its type (a class that must define an empty constructor).- Parameters:
type- the processor class to instantiate and add- See Also:
-
addProcessor
Adds a processor.- Parameters:
p- the processor instance to add- Returns:
trueif the processor was added- See Also:
-
addProcessor
Adds a processor by instantiating its type (a class that must define an empty constructor and implementProcessor).- Parameters:
qualifiedName- the qualified name of the processor's type- See Also:
-
getProcessors
Collection<Processor<?>> getProcessors()Gets the processors that have been added to the manager and that will be applied when invoking one of theprocessmethods).- Returns:
- the processors currently registered on this manager
- See Also:
-
process
Recursively processes a collection ofCtElements with this manager. All the processors added to this manager (seegetProcessors()) should be applied before the method returns (blocking implementation) or before another call to aprocessmethod (non-blocking implementation). Processors that have been applied are removed from the manager andgetProcessors()does not contain them anymore.- Parameters:
elements- the elements to process recursively
-
process
Recursively processes aCtElementwith this manager. All the processors added to this manager (seegetProcessors()) should be applied before the method returns (blocking implementation) or before another call to aprocessmethod (non-blocking implementation). Processors that have been applied are removed from the manager andgetProcessors()does not contain them anymore.- Parameters:
element- the element to process recursively
-