Interface IPreProcessor

All Known Implementing Classes:
PreProcessor

public interface IPreProcessor

Interface defining pre-processors.

Pre-processors are implementations of ITemplateHandler meant to be executed on template model events after parsing (or retrieving from cache) and before these events go through processing by all the applicable processors (implementations of IProcessor).

Pre-processors can be used to re-shape the template model just before it is processed.

Most of the times, the PreProcessor implementation will be used for registering pre-processors.

Since:
3.0.0
Author:
Daniel Fernández
  • Method Details

    • getTemplateMode

      TemplateMode getTemplateMode()

      Returns the template mode this pre-processor should be executed for. A pre-processor can only be linked to a specific template mode.

      Returns:
      the template mode.
    • getPrecedence

      int getPrecedence()

      Returns the precedence that should be applied to this pre-processor. This will determine the order in which it will be executed in relation to any other pre-processors (note that the dialect precedence determined by IPreProcessorDialect.getDialectPreProcessorPrecedence() will be applied first).

      Returns:
      the pre-processor precedence.
    • getHandlerClass

      Class<? extends ITemplateHandler> getHandlerClass()

      Returns the handler class for this pre-processor, the ITemplateHandler that implements the real logic to be executed.

      In order for pre-processors to work correctly, they need to implement correctly all the ITemplateHandler contract. In order to make this easier, extending AbstractTemplateHandler is recommended.

      Returns:
      the handler class.