Interface TemplateNode

All Known Implementing Classes:
ExpressionNode, LineSeparatorNode, ParameterDeclarationNode, SectionNode, TextNode

public interface TemplateNode
Tree node of a parsed template.
See Also:
  • Method Details

    • resolve

      Parameters:
      context -
      Returns:
      the result node
    • getExpressions

      default List<Expression> getExpressions()
      Returns:
      a list of expressions
    • getParameterDeclarations

      default List<ParameterDeclaration> getParameterDeclarations()
      Returns the parameter declarations defined in this template node.
      Returns:
      a list of param declarations
    • getOrigin

      TemplateNode.Origin getOrigin()
      Returns:
      the origin of the node
    • isConstant

      default boolean isConstant()
      Constant means a static text or a literal output expression.
      Returns:
      true if the node represents a constant
      See Also:
    • isSection

      default boolean isSection()
      Returns:
      true if the node represents a section
      See Also:
    • isText

      default boolean isText()
      Returns:
      true if the node represents a text
      See Also:
    • isExpression

      default boolean isExpression()
      Returns:
      true if the node represents an output expression
      See Also:
    • kind

      Returns the kind of this node.

      Note that comments and line separators are never preserved in the parsed template tree.

      Returns:
      the kind
    • asText

      default TextNode asText()
    • asSection

      default SectionNode asSection()
    • asExpression

      default ExpressionNode asExpression()
    • asParamDeclaration

      default ParameterDeclarationNode asParamDeclaration()