Class AbstractManualProcessor

java.lang.Object
spoon.processing.AbstractManualProcessor
All Implemented Interfaces:
FactoryAccessor, Processor<CtElement>
Direct Known Subclasses:
SpoonTagger

public abstract class AbstractManualProcessor extends Object implements Processor<CtElement>
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 Details

    • AbstractManualProcessor

      public AbstractManualProcessor()
      Empty constructor only for all processors (invoked by Spoon).
  • Method Details

    • addProcessedElementType

      protected void addProcessedElementType(Class<? extends CtElement> elementType)
      Invalid method in this context.
    • getEnvironment

      public Environment getEnvironment()
      Description copied from interface: Processor
      Gets the environment of this processor.
      Specified by:
      getEnvironment in interface Processor<CtElement>
    • getFactory

      public final Factory getFactory()
      Description copied from interface: FactoryAccessor
      Gets the factory of this object.
      Specified by:
      getFactory in interface FactoryAccessor
    • getProcessedElementTypes

      public final Set<Class<? extends CtElement>> getProcessedElementTypes()
      Invalid method in this context.
      Specified by:
      getProcessedElementTypes in interface Processor<CtElement>
    • getTraversalStrategy

      public final TraversalStrategy getTraversalStrategy()
      Invalid method in this context.
      Specified by:
      getTraversalStrategy in interface Processor<CtElement>
    • init

      public void init()
      Description copied from interface: Processor
      This method is upcalled 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.
      Specified by:
      init in interface Processor<CtElement>
    • isPrivileged

      public final boolean isPrivileged()
      Invalid method in this context.
    • isToBeProcessed

      public final boolean isToBeProcessed(CtElement candidate)
      Always returns false in this context.
      Specified by:
      isToBeProcessed in interface Processor<CtElement>
      Parameters:
      candidate - the candidate
      Returns:
      true if the candidate is to be processed by the Processor.process(CtElement)
    • process

      public final void process(CtElement element)
      Does nothing in this context.
      Specified by:
      process in interface Processor<CtElement>
      Parameters:
      element - the element that is currently being scanned
    • processingDone

      public void processingDone()
      Description copied from interface: Processor
      This method is upcalled by the ProcessingManager 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 (see ProcessingManager.addProcessor(Class)). Does nothing by default.
      Specified by:
      processingDone in interface Processor<CtElement>
    • setFactory

      public final void setFactory(Factory factory)
      Description copied from interface: FactoryAccessor
      Sets the factory object.
      Specified by:
      setFactory in interface FactoryAccessor
    • initProperties

      public final void initProperties(ProcessorProperties properties)
      Description copied from interface: Processor
      Initializes the properties defined by this processor by using the environment.
      Specified by:
      initProperties in interface Processor<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 the ProcessingManager.
      Specified by:
      interrupt in interface Processor<CtElement>