Package spoon.support
Class RuntimeProcessingManager
java.lang.Object
spoon.support.RuntimeProcessingManager
- All Implemented Interfaces:
FactoryAccessor,ProcessingManager
This processing manager implements a blocking processing policy that consists
of applying the processors in a FIFO order until no processors remain to be
applied.
-
Constructor Summary
ConstructorsConstructorDescriptionRuntimeProcessingManager(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).voidprocess(Collection<? extends CtElement> elements)Recursively processes a collection ofCtElements with this manager.voidprocess(Collection<? extends CtElement> elements, Processor<?> processor)Recursively processes elements and their children with a given processor.voidRecursively processes aCtElementwith this manager.voidRecursively processes an element and its children with a given processor.voidsetFactory(Factory factory)Sets the factory object.
-
Constructor Details
-
RuntimeProcessingManager
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)
-
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
Recursively processes elements and their children with a given processor. -
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
-
process
Recursively processes an element and its children with a given processor. -
setFactory
Description copied from interface:FactoryAccessorSets the factory object.- Specified by:
setFactoryin interfaceFactoryAccessor
-