Class OGNLVariableExpressionEvaluator
java.lang.Object
org.thymeleaf.standard.expression.OGNLVariableExpressionEvaluator
- All Implemented Interfaces:
IStandardVariableExpressionEvaluator
public final class OGNLVariableExpressionEvaluator
extends Object
implements IStandardVariableExpressionEvaluator
Evaluator for variable expressions (${...}) in Thymeleaf Standard Expressions, using the
OGNL expression language.
Note a class with this name existed since 2.0.9, but it was completely reimplemented in Thymeleaf 3.0
- Since:
- 3.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class(package private) static final class(package private) static final class(package private) static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate static OGNLVariableExpressionEvaluator.ThymeleafACLClassResolverprivate static final Stringprivate static final org.slf4j.Loggerprivate static ognl.MemberAccess -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Objectevaluate(IExpressionContext context, IStandardVariableExpression expression, StandardExpressionExecutionContext expContext) Evaluate the variable expression.private static Objectevaluate(IExpressionContext context, IStandardVariableExpression expression, StandardExpressionExecutionContext expContext, boolean applyOGNLShortcuts) private static ObjectexecuteExpression(IEngineConfiguration configuration, Object parsedExpression, Map<String, Object> context, Object root) private static voidinvalidateComputedOGNLExpression(IEngineConfiguration configuration, IStandardVariableExpression expression, String exp) private static OGNLVariableExpressionEvaluator.ComputedOGNLExpressionobtainComputedOGNLExpression(IEngineConfiguration configuration, IStandardVariableExpression expression, String exp, StandardExpressionExecutionContext expContext, boolean applyOGNLShortcuts) private static OGNLVariableExpressionEvaluator.ComputedOGNLExpressionparseComputedOGNLExpression(IEngineConfiguration configuration, String exp, boolean applyOGNLShortcuts) private static OGNLVariableExpressionEvaluator.ComputedOGNLExpressionparseExpression(String expression, boolean applyOGNLShortcuts) toString()
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
EXPRESSION_CACHE_TYPE_OGNL
- See Also:
-
CONTEXT_VARIABLES_MAP_NOEXPOBJECTS_RESTRICTIONS
-
MEMBER_ACCESS
private static ognl.MemberAccess MEMBER_ACCESS -
CLASS_RESOLVER
-
applyOGNLShortcuts
private final boolean applyOGNLShortcuts
-
-
Constructor Details
-
OGNLVariableExpressionEvaluator
public OGNLVariableExpressionEvaluator(boolean applyOGNLShortcuts)
-
-
Method Details
-
evaluate
public final Object evaluate(IExpressionContext context, IStandardVariableExpression expression, StandardExpressionExecutionContext expContext) Description copied from interface:IStandardVariableExpressionEvaluatorEvaluate the variable expression.
- Specified by:
evaluatein interfaceIStandardVariableExpressionEvaluator- Parameters:
context- the context object.expression- the standard variable expression to be evaluated.expContext- the expression execution context to be applied (preprocessing, etc.)- Returns:
- the result of evaluating the expression.
-
evaluate
private static Object evaluate(IExpressionContext context, IStandardVariableExpression expression, StandardExpressionExecutionContext expContext, boolean applyOGNLShortcuts) -
obtainComputedOGNLExpression
private static OGNLVariableExpressionEvaluator.ComputedOGNLExpression obtainComputedOGNLExpression(IEngineConfiguration configuration, IStandardVariableExpression expression, String exp, StandardExpressionExecutionContext expContext, boolean applyOGNLShortcuts) throws ognl.OgnlException - Throws:
ognl.OgnlException
-
parseComputedOGNLExpression
private static OGNLVariableExpressionEvaluator.ComputedOGNLExpression parseComputedOGNLExpression(IEngineConfiguration configuration, String exp, boolean applyOGNLShortcuts) throws ognl.OgnlException - Throws:
ognl.OgnlException
-
invalidateComputedOGNLExpression
private static void invalidateComputedOGNLExpression(IEngineConfiguration configuration, IStandardVariableExpression expression, String exp) -
toString
-
parseExpression
private static OGNLVariableExpressionEvaluator.ComputedOGNLExpression parseExpression(String expression, boolean applyOGNLShortcuts) throws ognl.OgnlException - Throws:
ognl.OgnlException
-
executeExpression
private static Object executeExpression(IEngineConfiguration configuration, Object parsedExpression, Map<String, Object> context, Object root) throws Exception- Throws:
Exception
-