Class EagerTagDecorator<T extends Tag>

    • Constructor Detail

      • EagerTagDecorator

        public EagerTagDecorator​(T tag)
    • Method Detail

      • getTag

        public T getTag()
      • getEndTagName

        public String getEndTagName()
        Specified by:
        getEndTagName in interface Tag
        Returns:
        Get name of end tag (lowerCase). Null if it's a single tag without content.
      • eagerInterpret

        public String eagerInterpret​(TagNode tagNode,
                                     JinjavaInterpreter interpreter,
                                     InterpretException e)
        Return the string value of interpreting this tag node knowing that a deferred value has been encountered. The tag node can not simply get evaluated normally in this circumstance.
        Parameters:
        tagNode - TagNode to interpret.
        interpreter - The JinjavaInterpreter.
        e - The exception that required non-default interpretation. May be null
        Returns:
        The string result of performing an eager interpretation of the TagNode
      • renderChildren

        public String renderChildren​(TagNode tagNode,
                                     JinjavaInterpreter interpreter)
        Render all children of this TagNode.
        Parameters:
        tagNode - TagNode to render the children of.
        interpreter - The JinjavaInterpreter.
        Returns:
        the string output of this tag node's children.
      • getEagerImage

        public final String getEagerImage​(Token token,
                                          JinjavaInterpreter interpreter)
        Casts token to TagToken if possible to get the eager image of the token.
        Parameters:
        token - Token to cast.
        interpreter - The Jinjava interpreter.
        Returns:
        The image of the token which has been evaluated as much as possible.
        See Also:
        getEagerTagImage(TagToken, JinjavaInterpreter)
      • getEagerTagImage

        public String getEagerTagImage​(TagToken tagToken,
                                       JinjavaInterpreter interpreter)
        Uses the EagerExpressionResolver to partially evaluate any expression within the tagToken's helpers. If there are any macro functions that must be deferred, then their images are pre-pended to the result, which is the partial image of the TagToken.
        Parameters:
        tagToken - TagToken to get the eager image of.
        interpreter - The Jinjava interpreter.
        Returns:
        A new image of the tagToken, which may have expressions that are further resolved than in the original Token.getImage().