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
ConstructorsConstructorDescriptionEmpty constructor only for all processors (invoked by Spoon). -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddProcessedElementType(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.voidinit()This method is called to initialize the processor before each processing round.voidinitProperties(ProcessorProperties properties)Initializes the properties defined by this processor by using the environment.voidInterrupts 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.booleanInvalid method in this context.booleanisToBeProcessed(CtElement candidate)Always returns false in this context.voidDoes nothing in this context.voidThis method is called by theProcessingManagerwhen this processor has finished a full processing round on the program's model.voidsetFactory(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:ProcessorGets the environment of this processor.- Specified by:
getEnvironmentin interfaceProcessor<CtElement>
-
getFactory
Description copied from interface:FactoryAccessorGets the factory of this object.- Specified by:
getFactoryin interfaceFactoryAccessor
-
getProcessedElementTypes
Invalid method in this context.- Specified by:
getProcessedElementTypesin interfaceProcessor<CtElement>
-
getTraversalStrategy
Invalid method in this context.- Specified by:
getTraversalStrategyin interfaceProcessor<CtElement>
-
init
public void init()Description copied from interface:ProcessorThis 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:
isToBeProcessedin 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:ProcessorThis method is called by theProcessingManagerwhen 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:
processingDonein interfaceProcessor<CtElement>
-
setFactory
Description copied from interface:FactoryAccessorSets the factory object.- Specified by:
setFactoryin interfaceFactoryAccessor
-
initProperties
Description copied from interface:ProcessorInitializes the properties defined by this processor by using the environment.- Specified by:
initPropertiesin interfaceProcessor<CtElement>- See Also:
Environment.getProcessorProperties(String)
-
interrupt
public void interrupt()Description copied from interface:ProcessorInterrupts 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.
-