Package spoon.processing
Interface ProcessingManager
-
- All Superinterfaces:
FactoryAccessor
- All Known Implementing Classes:
QueueProcessingManager
,RuntimeProcessingManager
public interface ProcessingManager extends FactoryAccessor
The processing manager defines the API to process a program model of a givenFactory
with a set of processors. The program model has been previously built using aSpoonModelBuilder
- seeSpoonModelBuilder.build()
. To use, add processors to the manager, and then call theprocess
method. Also, the methodProcessor.processingDone()
is up called.- See Also:
Environment.getManager()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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.Collection<Processor<?>>
getProcessors()
Gets the processors that have been added to the manager and that will be applied when invoking one of theprocess
methods).void
process(Collection<? extends CtElement> elements)
Recursively processes a collection ofCtElement
s with this manager.void
process(CtElement element)
Recursively processes aCtElement
with this manager.-
Methods inherited from interface spoon.processing.FactoryAccessor
getFactory, setFactory
-
-
-
-
Method Detail
-
addProcessor
void addProcessor(Class<? extends Processor<?>> type)
Adds a processor by instantiating its type (a class that must define an empty constructor).- See Also:
getProcessors()
-
addProcessor
boolean addProcessor(Processor<?> p)
Adds a processor.- See Also:
getProcessors()
-
addProcessor
void addProcessor(String qualifiedName)
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()
-
getProcessors
Collection<Processor<?>> getProcessors()
Gets the processors that have been added to the manager and that will be applied when invoking one of theprocess
methods).- See Also:
process(Collection)
-
process
void process(Collection<? extends CtElement> elements)
Recursively processes a collection ofCtElement
s 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 aprocess
method (non-blocking implementation). Processors that have been applied are removed from the manager andgetProcessors()
does not contain them anymore.
-
process
void process(CtElement element)
Recursively processes aCtElement
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 aprocess
method (non-blocking implementation). Processors that have been applied are removed from the manager andgetProcessors()
does not contain them anymore.
-
-