Package spoon.support
Class QueueProcessingManager
java.lang.Object
spoon.support.QueueProcessingManager
- All Implemented Interfaces:
FactoryAccessor
,ProcessingManager
This processing manager applies the processors one by one from the given root element.
for p : processors
p.process(el)
Default processor in Spoon
-
Constructor Summary
ConstructorDescriptionQueueProcessingManager(Factory factory)
Creates a new processing manager that maintains a queue of processors to be applied to a given factory. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProcessor(Class<? extends Processor<?>> type)
Adds a processor by instantiating its type (a class that must define an empty constructor).void
addProcessor(String qualifiedName)
Adds a processor by instantiating its type (a class that must define an empty constructor and implementProcessor
).boolean
addProcessor(Processor<?> p)
Adds a processor.Processor<?>
Gets the factory of this object.Gets the processors that have been added to the manager and that will be applied when invoking one of theprocess
methods).protected ProcessingVisitor
void
process(Collection<? extends CtElement> elements)
Recursively processes a collection ofCtElement
s with this manager.void
Recursively processes aCtElement
with this manager.void
setFactory(Factory factory)
Sets the factory object.
-
Constructor Details
-
QueueProcessingManager
Creates a new processing manager that maintains a queue of processors to be applied to a given factory.- Parameters:
factory
- the factory on which the processing applies (contains the meta-model)
-
-
Method Details
-
addProcessor
Description copied from interface:ProcessingManager
Adds a processor by instantiating its type (a class that must define an empty constructor).- Specified by:
addProcessor
in interfaceProcessingManager
- See Also:
ProcessingManager.getProcessors()
-
addProcessor
Description copied from interface:ProcessingManager
Adds a processor.- Specified by:
addProcessor
in interfaceProcessingManager
- See Also:
ProcessingManager.getProcessors()
-
addProcessor
Description copied from interface:ProcessingManager
Adds a processor by instantiating its type (a class that must define an empty constructor and implementProcessor
).- Specified by:
addProcessor
in interfaceProcessingManager
- Parameters:
qualifiedName
- the qualified name of the processor's type- See Also:
ProcessingManager.getProcessors()
-
getCurrentProcessor
-
getFactory
Description copied from interface:FactoryAccessor
Gets the factory of this object.- Specified by:
getFactory
in interfaceFactoryAccessor
-
getProcessors
Description copied from interface:ProcessingManager
Gets the processors that have been added to the manager and that will be applied when invoking one of theprocess
methods).- Specified by:
getProcessors
in interfaceProcessingManager
- See Also:
ProcessingManager.process(Collection)
-
getVisitor
-
process
Description copied from interface:ProcessingManager
Recursively processes a collection ofCtElement
s with this manager. All the processors added to this manager (seeProcessingManager.getProcessors()
) should be applied before the method returns (blocking implementation) or before another call to aprocess
method (non-blocking implementation). Processors that have been applied are removed from the manager andProcessingManager.getProcessors()
does not contain them anymore.- Specified by:
process
in interfaceProcessingManager
-
process
Description copied from interface:ProcessingManager
Recursively processes aCtElement
with this manager. All the processors added to this manager (seeProcessingManager.getProcessors()
) should be applied before the method returns (blocking implementation) or before another call to aprocess
method (non-blocking implementation). Processors that have been applied are removed from the manager andProcessingManager.getProcessors()
does not contain them anymore.- Specified by:
process
in interfaceProcessingManager
-
setFactory
Description copied from interface:FactoryAccessor
Sets the factory object.- Specified by:
setFactory
in interfaceFactoryAccessor
-