Interface TemplateEntry

All Known Implementing Classes:
CompoundTemplateEntry, Condition, ContextSwitchTemplate, SearchExpressionCondition, StaticText, Variable

public interface TemplateEntry
Interface for one node in the abstract syntax tree that is the result of parsing a template string with TemplateParser. The node can either be branching (condition, context switch) or a leaf node (variable, static text). The root node, representing the entire template is also a TemplateEntry.
  • Method Details

    • getText

      default String getText(TemplateEngineDataProvider dataProvider)
      Execute this template by generating text for a given data provider.
      Parameters:
      dataProvider - the data provider from which information should be compiled to a string
      Returns:
      the generated text
    • appendText

      Execute this template by generating text for a given data provider.
      Parameters:
      result - the StringBuilder to append the text to
      dataProvider - the data provider from which information should be compiled to a string
    • isValid

      boolean isValid(TemplateEngineDataProvider dataProvider)
      Check if this template is applicable to the given data provider.
      Parameters:
      dataProvider - the data provider to check
      Returns:
      true if all conditions are fulfilled to apply the template (for instance all required key=value mappings are present), false otherwise