org.springframework.context.expression

## 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:
    `AnnotatedElementKey`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `CachedExpressionEvaluator.ExpressionKey` An expression key.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `CachedExpressionEvaluator()` Create a new instance with a default `SpelExpressionParser`.
    `protected` | `CachedExpressionEvaluator(SpelExpressionParser parser)` Create a new instance with the specified `SpelExpressionParser`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Expression` | `getExpression(Map<CachedExpressionEvaluator.ExpressionKey,Expression> cache, AnnotatedElementKey elementKey, String expression)` Return the `Expression` for the specified SpEL value
    `protected ParameterNameDiscoverer` | `getParameterNameDiscoverer()` Return a shared parameter name discoverer which caches data internally.
    `protected SpelExpressionParser` | `getParser()` Return the `SpelExpressionParser` to use.
    `protected Expression` | `parseExpression(String expression)` Parse the specified `expression`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CachedExpressionEvaluator

          protected CachedExpressionEvaluator(SpelExpressionParser parser)

      Create a new instance with the specified `SpelExpressionParser`.

    - #### CachedExpressionEvaluator

          protected CachedExpressionEvaluator()

      Create a new instance with a default `SpelExpressionParser`.

  - ### Method Detail

    - #### 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 `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 Expression parseExpression(String expression)

      Parse the specified `expression`.
      Parameters:
        `expression` - the expression to parse
      Since:
        5.3.13