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
ConstructorsConstructorDescriptionQueueProcessingManager(Factory factory)Creates a new processing manager that maintains a queue of processors to be applied to a given factory. -
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.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 theprocessmethods).protected ProcessingVisitorvoidprocess(Collection<? extends CtElement> elements)Recursively processes a collection ofCtElements with this manager.voidRecursively processes aCtElementwith this manager.voidsetFactory(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:ProcessingManagerAdds a processor by instantiating its type (a class that must define an empty constructor).- Specified by:
addProcessorin interfaceProcessingManager- See Also:
ProcessingManager.getProcessors()
-
addProcessor
Description copied from interface:ProcessingManagerAdds a processor.- Specified by:
addProcessorin interfaceProcessingManager- See Also:
ProcessingManager.getProcessors()
-
addProcessor
Description copied from interface:ProcessingManagerAdds a processor by instantiating its type (a class that must define an empty constructor and implementProcessor).- Specified by:
addProcessorin interfaceProcessingManager- Parameters:
qualifiedName- the qualified name of the processor's type- See Also:
ProcessingManager.getProcessors()
-
getCurrentProcessor
-
getFactory
Description copied from interface:FactoryAccessorGets the factory of this object.- Specified by:
getFactoryin interfaceFactoryAccessor
-
getProcessors
Description copied from interface:ProcessingManagerGets the processors that have been added to the manager and that will be applied when invoking one of theprocessmethods).- Specified by:
getProcessorsin interfaceProcessingManager- See Also:
ProcessingManager.process(Collection)
-
getVisitor
-
process
Description copied from interface:ProcessingManagerRecursively processes a collection ofCtElements 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 aprocessmethod (non-blocking implementation). Processors that have been applied are removed from the manager andProcessingManager.getProcessors()does not contain them anymore.- Specified by:
processin interfaceProcessingManager
-
process
Description copied from interface:ProcessingManagerRecursively processes aCtElementwith 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 aprocessmethod (non-blocking implementation). Processors that have been applied are removed from the manager andProcessingManager.getProcessors()does not contain them anymore.- Specified by:
processin interfaceProcessingManager
-
setFactory
Description copied from interface:FactoryAccessorSets the factory object.- Specified by:
setFactoryin interfaceFactoryAccessor
-