Package spoon.processing
Class AbstractManualProcessor
java.lang.Object
spoon.processing.AbstractManualProcessor
- All Implemented Interfaces:
FactoryAccessor
,Processor<CtElement>
- Direct Known Subclasses:
SpoonTagger
This class defines an abstract processor to be subclassed by the user for
defining new manual processors. A manual processor should override the init
method (called once) and scan the meta-model manually.
-
Constructor Summary
ConstructorDescriptionEmpty constructor only for all processors (invoked by Spoon). -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addProcessedElementType(Class<? extends CtElement> elementType)
Invalid method in this context.Gets the environment of this processor.Gets the factory of this object.Invalid method in this context.Invalid method in this context.void
init()
This method is called to initialize the processor before each processing round.void
initProperties(ProcessorProperties properties)
Initializes the properties defined by this processor by using the environment.void
Interrupts the processing of this processor but changes on your AST are kept and the invocation of this method doesn't interrupt the processing of all processors specified in theProcessingManager
.boolean
Invalid method in this context.boolean
isToBeProcessed(CtElement candidate)
Always returns false in this context.void
Does nothing in this context.void
This method is called by theProcessingManager
when this processor has finished a full processing round on the program's model.void
setFactory(Factory factory)
Sets the factory object.
-
Constructor Details
-
AbstractManualProcessor
public AbstractManualProcessor()Empty constructor only for all processors (invoked by Spoon).
-
-
Method Details
-
addProcessedElementType
Invalid method in this context. -
getEnvironment
Description copied from interface:Processor
Gets the environment of this processor.- Specified by:
getEnvironment
in interfaceProcessor<CtElement>
-
getFactory
Description copied from interface:FactoryAccessor
Gets the factory of this object.- Specified by:
getFactory
in interfaceFactoryAccessor
-
getProcessedElementTypes
Invalid method in this context.- Specified by:
getProcessedElementTypes
in interfaceProcessor<CtElement>
-
getTraversalStrategy
Invalid method in this context.- Specified by:
getTraversalStrategy
in interfaceProcessor<CtElement>
-
init
public void init()Description copied from interface:Processor
This method is called to initialize the processor before each processing round. It is convenient to override this method rather than using a default constructor to initialize the processor, since the factory is not initialized at construction time. When overriding, do not forget to call super.init() first so that all the initializations performed by superclasses are also applied. -
isPrivileged
public final boolean isPrivileged()Invalid method in this context. -
isToBeProcessed
Always returns false in this context.- Specified by:
isToBeProcessed
in interfaceProcessor<CtElement>
- Parameters:
candidate
- the candidate- Returns:
- true if the candidate is to be processed by the
Processor.process(CtElement)
-
process
Does nothing in this context. -
processingDone
public void processingDone()Description copied from interface:Processor
This method is called by theProcessingManager
when this processor has finished a full processing round on the program's model. It is convenient to override this method to tune the application's strategy of a set of processors, for instance by dynamically adding processors to the processing manager when a processing round ends (seeProcessingManager.addProcessor(Class)
). Does nothing by default.- Specified by:
processingDone
in interfaceProcessor<CtElement>
-
setFactory
Description copied from interface:FactoryAccessor
Sets the factory object.- Specified by:
setFactory
in interfaceFactoryAccessor
-
initProperties
Description copied from interface:Processor
Initializes the properties defined by this processor by using the environment.- Specified by:
initProperties
in interfaceProcessor<CtElement>
- See Also:
Environment.getProcessorProperties(String)
-
interrupt
public void interrupt()Description copied from interface:Processor
Interrupts the processing of this processor but changes on your AST are kept and the invocation of this method doesn't interrupt the processing of all processors specified in theProcessingManager
.
-