Class CachedExpressionEvaluator
java.lang.Object
org.springframework.context.expression.CachedExpressionEvaluator
Shared utility class used to evaluate and cache SpEL expressions that
are defined on
AnnotatedElement
.- Since:
- 4.2
- Author:
- Stephane Nicoll
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
An expression key. -
Constructor Summary
ModifierConstructorDescriptionprotected
Create a new instance with a defaultSpelExpressionParser
.protected
Create a new instance with the specifiedSpelExpressionParser
. -
Method Summary
Modifier and TypeMethodDescriptionprotected Expression
getExpression
(Map<CachedExpressionEvaluator.ExpressionKey, Expression> cache, AnnotatedElementKey elementKey, String expression) Return theExpression
for the specified SpEL valueprotected ParameterNameDiscoverer
Return a shared parameter name discoverer which caches data internally.protected SpelExpressionParser
Return theSpelExpressionParser
to use.protected Expression
parseExpression
(String expression) Parse the specifiedexpression
.
-
Constructor Details
-
CachedExpressionEvaluator
Create a new instance with the specifiedSpelExpressionParser
. -
CachedExpressionEvaluator
protected CachedExpressionEvaluator()Create a new instance with a defaultSpelExpressionParser
.
-
-
Method Details
-
getParser
Return theSpelExpressionParser
to use. -
getParameterNameDiscoverer
Return a shared parameter name discoverer which caches data internally.- Since:
- 4.3
-
getExpression
protected Expression getExpression(Map<CachedExpressionEvaluator.ExpressionKey, Expression> cache, AnnotatedElementKey elementKey, String expression) Return theExpression
for the specified SpEL valueParse the expression
if it hasn't been already.- Parameters:
cache
- the cache to useelementKey
- the element on which the expression is definedexpression
- the expression to parse
-
parseExpression
Parse the specifiedexpression
.- Parameters:
expression
- the expression to parse- Since:
- 5.3.13
-