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

  • Method Details

    • getParser

      protected SpelExpressionParser getParser()
      Return the SpelExpressionParser to 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 the parsed Expression for the specified SpEL expression.

      Parses the expression if it hasn't already been parsed and cached.

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

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