Class CachedExpressionEvaluator
- java.lang.Object
- org.springframework.context.expression.CachedExpressionEvaluator
public abstract class CachedExpressionEvaluator extends Object
Shared utility class used to evaluate and cache SpEL expressions that are defined onAnnotatedElement.- Since:
- 4.2
- Author:
- Stephane Nicoll
- See Also:
AnnotatedElementKey
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classCachedExpressionEvaluator.ExpressionKey
Constructor Summary
Constructors Modifier Constructor Description protectedCachedExpressionEvaluator()Create a new instance with a defaultSpelExpressionParser.protectedCachedExpressionEvaluator(SpelExpressionParser parser)Create a new instance with the specifiedSpelExpressionParser.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ExpressiongetExpression(Map<CachedExpressionEvaluator.ExpressionKey,Expression> cache, AnnotatedElementKey elementKey, String expression)Return theExpressionfor the specified SpEL valueprotected ParameterNameDiscoverergetParameterNameDiscoverer()Return a shared parameter name discoverer which caches data internally.protected SpelExpressionParsergetParser()Return theSpelExpressionParserto use.
Constructor Detail
CachedExpressionEvaluator
protected CachedExpressionEvaluator(SpelExpressionParser parser)
Create a new instance with the specifiedSpelExpressionParser.
CachedExpressionEvaluator
protected CachedExpressionEvaluator()
Create a new instance with a defaultSpelExpressionParser.
Method Detail
getParser
protected SpelExpressionParser getParser()
Return theSpelExpressionParserto use.
getParameterNameDiscoverer
protected ParameterNameDiscoverer 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 theExpressionfor 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