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 on AnnotatedElement.
Since:
4.2
Author:
Stephane Nicoll
See Also:
  • Constructor Details

    • CachedExpressionEvaluator

      protected CachedExpressionEvaluator(org.springframework.expression.spel.standard.SpelExpressionParser parser)
      Create a new instance with the specified SpelExpressionParser.
    • CachedExpressionEvaluator

      protected CachedExpressionEvaluator()
      Create a new instance with a default SpelExpressionParser.
  • Method Details

    • getParser

      protected org.springframework.expression.spel.standard.SpelExpressionParser getParser()
      Return the SpelExpressionParser to 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 Expression for the specified SpEL value

      Parse the expression if it hasn't been already.

      Parameters:
      cache - the cache to use
      elementKey - the element on which the expression is defined
      expression - the expression to parse
    • parseExpression

      protected org.springframework.expression.Expression parseExpression(String expression)
      Parse the specified expression.
      Parameters:
      expression - the expression to parse
      Since:
      5.3.13