Class TemplateBoundariesStructureHandler

java.lang.Object
org.thymeleaf.engine.TemplateBoundariesStructureHandler
All Implemented Interfaces:
ITemplateBoundariesStructureHandler

public final class TemplateBoundariesStructureHandler extends Object implements ITemplateBoundariesStructureHandler

Structure handler implementation, internally used by the engine.

This class should not be directly used from outside the engine.

Since:
3.0.0
  • Field Details

    • insertText

      boolean insertText
    • insertTextValue

      String insertTextValue
    • insertTextProcessable

      boolean insertTextProcessable
    • insertModel

      boolean insertModel
    • insertModelValue

      IModel insertModelValue
    • insertModelProcessable

      boolean insertModelProcessable
    • setLocalVariable

      boolean setLocalVariable
    • addedLocalVariables

      Map<String,Object> addedLocalVariables
    • removeLocalVariable

      boolean removeLocalVariable
    • removedLocalVariableNames

      Set<String> removedLocalVariableNames
    • setSelectionTarget

      boolean setSelectionTarget
    • selectionTargetObject

      Object selectionTargetObject
    • setInliner

      boolean setInliner
    • setInlinerValue

      IInliner setInlinerValue
  • Constructor Details

    • TemplateBoundariesStructureHandler

      TemplateBoundariesStructureHandler()
  • Method Details

    • insert

      public void insert(String text, boolean processable)
      Description copied from interface: ITemplateBoundariesStructureHandler

      Instructs the engine to insert the specified text.

      If the processed event is a ITemplateStart event, then the text will be inserted at the beginning of the template (just after the template start event). On the other hand, if the processed event is a ITemplateEnd event, then the text will be inserted at the end of the template (just before the template end event).

      Specified by:
      insert in interface ITemplateBoundariesStructureHandler
      Parameters:
      text - the text to be inserted.
      processable - whether the inserted text should be considered processable or not.
    • insert

      public void insert(IModel model, boolean processable)
      Description copied from interface: ITemplateBoundariesStructureHandler

      Instructs the engine to insert the specified model.

      If the processed event is a ITemplateStart event, then the model will be inserted at the beginning of the template (just after the template start event). On the other hand, if the processed event is a ITemplateEnd event, then the model will be inserted at the end of the template (just before the template end event).

      Specified by:
      insert in interface ITemplateBoundariesStructureHandler
      Parameters:
      model - the model to be inserted.
      processable - whether the inserted text should be considered processable or not.
    • removeLocalVariable

      public void removeLocalVariable(String name)
      Description copied from interface: ITemplateBoundariesStructureHandler

      Instructs the engine to remove a local variable.

      Specified by:
      removeLocalVariable in interface ITemplateBoundariesStructureHandler
      Parameters:
      name - the name of the variable.
    • setLocalVariable

      public void setLocalVariable(String name, Object value)
      Description copied from interface: ITemplateBoundariesStructureHandler

      Instructs the engine to set a new local variable.

      Specified by:
      setLocalVariable in interface ITemplateBoundariesStructureHandler
      Parameters:
      name - the name of the variable.
      value - the value of the variable.
    • setSelectionTarget

      public void setSelectionTarget(Object selectionTarget)
      Description copied from interface: ITemplateBoundariesStructureHandler

      Instructs the engine to set a new selection target.

      The selection target is the object on which selection expressions (*{...}) are executed. In the Standard Dialect, this selection target is usually modified by means of the th:object attribute, but custom processors can do it too. Note the selection target has the same scope as a local variable, and will therefore be accessible only inside the body of the element being processed.

      See ITemplateContext.getSelectionTarget()

      Specified by:
      setSelectionTarget in interface ITemplateBoundariesStructureHandler
      Parameters:
      selectionTarget - the selection target to be set.
    • setInliner

      public void setInliner(IInliner inliner)
      Description copied from interface: ITemplateBoundariesStructureHandler

      Instructs the engine to set a new inliner.

      Inliners are used for processing all text nodes (IText events) appearing in the body of the element being processed. This is the mechanism used by the th:inline attribute to enable inlining in any of the specified modes (text, javascript, etc).

      See ITemplateContext.getInliner()

      Specified by:
      setInliner in interface ITemplateBoundariesStructureHandler
      Parameters:
      inliner - the inliner.
    • reset

      public void reset()
      Description copied from interface: ITemplateBoundariesStructureHandler

      Resets all actions specified so far for the current processor execution.

      Specified by:
      reset in interface ITemplateBoundariesStructureHandler
    • resetAllButLocalVariables

      private void resetAllButLocalVariables()
    • applyContextModifications

      void applyContextModifications(IEngineContext engineContext)