Class CachedExpressionEvaluator
java.lang.Object
org.springframework.context.expression.CachedExpressionEvaluator
Shared utility class used to evaluate and cache SpEL expressions that
are defined on an
AnnotatedElement.- Since:
- 4.2
- Author:
- Stephane Nicoll
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classAn expression key. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreate a new instance with the defaultSpelExpressionParser.protectedCachedExpressionEvaluator(org.springframework.expression.spel.standard.SpelExpressionParser parser) Create a new instance with the specifiedSpelExpressionParser. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.expression.ExpressiongetExpression(Map<CachedExpressionEvaluator.ExpressionKey, org.springframework.expression.Expression> cache, AnnotatedElementKey elementKey, String expression) Return the parsedExpressionfor the specified SpEL expression.protected org.springframework.core.ParameterNameDiscovererReturn a shared parameter name discoverer which caches data internally.protected org.springframework.expression.spel.standard.SpelExpressionParserReturn theSpelExpressionParserto use.protected org.springframework.expression.ExpressionparseExpression(String expression) Parse the specifiedexpression.
-
Constructor Details
-
CachedExpressionEvaluator
protected CachedExpressionEvaluator()Create a new instance with the defaultSpelExpressionParser. -
CachedExpressionEvaluator
protected CachedExpressionEvaluator(org.springframework.expression.spel.standard.SpelExpressionParser parser) Create a new instance with the specifiedSpelExpressionParser.
-
-
Method Details
-
getParser
protected org.springframework.expression.spel.standard.SpelExpressionParser getParser()Return theSpelExpressionParserto use. -
getParameterNameDiscoverer
protected org.springframework.core.ParameterNameDiscoverer getParameterNameDiscoverer()Return a shared parameter name discoverer which caches data internally.- Since:
- 4.3
-
getExpression
protected org.springframework.expression.Expression getExpression(Map<CachedExpressionEvaluator.ExpressionKey, org.springframework.expression.Expression> cache, AnnotatedElementKey elementKey, String expression) Return the parsedExpressionfor the specified SpEL expression.Parses the expression if it hasn't already been parsed and cached.
- Parameters:
cache- the cache to useelementKey- theAnnotatedElementKeycontaining 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
-