Class EagerPrintTag
- java.lang.Object
-
- com.hubspot.jinjava.lib.tag.eager.EagerTagDecorator<T>
-
- com.hubspot.jinjava.lib.tag.eager.EagerStateChangingTag<PrintTag>
-
- com.hubspot.jinjava.lib.tag.eager.EagerPrintTag
-
- All Implemented Interfaces:
Importable
,Tag
,Serializable
public class EagerPrintTag extends EagerStateChangingTag<PrintTag>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EagerPrintTag()
EagerPrintTag(PrintTag printTag)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEagerTagImage(TagToken tagToken, JinjavaInterpreter interpreter)
Uses theEagerExpressionResolver
to partially evaluate any expression within the tagToken's helpers.static String
interpretExpression(String expr, TagToken tagToken, JinjavaInterpreter interpreter, boolean includeExpressionResult)
Interprets the expression, which may depend on deferred values.-
Methods inherited from class com.hubspot.jinjava.lib.tag.eager.EagerStateChangingTag
eagerInterpret, innerInterpret
-
Methods inherited from class com.hubspot.jinjava.lib.tag.eager.EagerTagDecorator
buildToken, getEagerImage, getEndTagName, getName, getTag, interpret, isRenderedInValidationMode, renderChildren
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.hubspot.jinjava.lib.tag.Tag
interpretOutput
-
-
-
-
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 theEagerExpressionResolver
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 theTagToken
.- Overrides:
getEagerTagImage
in classEagerTagDecorator<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 ifincludeExpressionResult
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.
-
-