Class EagerPrintTag

    • Constructor Detail

      • EagerPrintTag

        public EagerPrintTag()
      • EagerPrintTag

        public EagerPrintTag​(PrintTag printTag)
    • Method Detail

      • getEagerTagImage

        public String getEagerTagImage​(TagToken tagToken,
                                       JinjavaInterpreter interpreter)
        Description copied from class: EagerTagDecorator
        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.
        Overrides:
        getEagerTagImage in class EagerTagDecorator<PrintTag>
        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().
      • interpretExpression

        public static String interpretExpression​(String expr,
                                                 TagToken tagToken,
                                                 JinjavaInterpreter interpreter,
                                                 boolean includeExpressionResult)
        Interprets the expression, which may depend on deferred values. If the expression can be entirely evaluated, return the result only if includeExpressionResult is true. When the expression depends on deferred values, then reconstruct the tag.
        Parameters:
        expr - Expression to interpret.
        tagToken - TagToken which is calling the expression.
        interpreter - The Jinjava interpreter.
        includeExpressionResult - Whether to include the result of the expression in the output.
        Returns:
        The result of the expression, if requested. OR a reconstruction of the calling tag.