Package com.hubspot.jinjava.util
Class EagerExpressionResolver
java.lang.Object
com.hubspot.jinjava.util.EagerExpressionResolver
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindDeferredWords(String partiallyResolved, JinjavaInterpreter interpreter) static Stringstatic booleanisPrimitive(Object val) static booleanisResolvableObject(Object val) static booleanisResolvableObject(Object val, int maxDepth, int maxSize) resolveExpression(String expression, JinjavaInterpreter interpreter) Resolve the expression while handling deferred values.static booleanshouldBeEvaluated(String w, JinjavaInterpreter interpreter)
-
Field Details
-
JINJAVA_NULL
- See Also:
-
JINJAVA_EMPTY_STRING
- See Also:
-
-
Constructor Details
-
EagerExpressionResolver
public EagerExpressionResolver()
-
-
Method Details
-
resolveExpression
public static EagerExpressionResolver.EagerExpressionResult resolveExpression(String expression, JinjavaInterpreter interpreter) Resolve the expression while handling deferred values. Returns a EagerExpressionResult object which either holds the fully resolved object or a partially resolved string as well as a set of any words that couldn't be resolved. If a DeferredParsingException is thrown, the expression was partially resolved. If a DeferredValueException is thrown, the expression could not be resolved at all.E.g with foo=3, bar=2: "range(0,foo)[-1] + deferred/bar" -> "2 + deferred/2"
-
getValueAsJinjavaStringSafe
-
findDeferredWords
public static Set<String> findDeferredWords(String partiallyResolved, JinjavaInterpreter interpreter) -
shouldBeEvaluated
-
isResolvableObject
-
isResolvableObject
-
isPrimitive
-