Class 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 Detail

      • AbstractManualProcessor

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

      • addProcessedElementType

        protected void addProcessedElementType​(Class<? extends CtElement> elementType)
        Invalid method in this context.
      • 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.
        Specified by:
        init in interface Processor<CtElement>
      • isPrivileged

        public final boolean isPrivileged()
        Invalid method in this context.
      • 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 called 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>
      • 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>