Package org.springframework.data.spel
Class ExtensionAwareEvaluationContextProvider
java.lang.Object
org.springframework.data.spel.ExtensionAwareEvaluationContextProvider
- All Implemented Interfaces:
EvaluationContextProvider
public class ExtensionAwareEvaluationContextProvider
extends Object
implements EvaluationContextProvider
An
EvaluationContextProvider
that assembles an EvaluationContext
from a list of
EvaluationContextExtension
instances.- Since:
- 2.1
- Author:
- Thomas Darimont, Oliver Gierke, Christoph Strobl, Jens Schauder, Mark Paluch
-
Field Summary
Fields inherited from interface org.springframework.data.spel.EvaluationContextProvider
DEFAULT
-
Constructor Summary
ConstructorDescriptionExtensionAwareEvaluationContextProvider
(Collection<? extends ExtensionIdAware> extensions) Creates a newExtensionAwareEvaluationContextProvider
for the givenEvaluationContextExtension
s.ExtensionAwareEvaluationContextProvider
(org.springframework.beans.factory.ListableBeanFactory beanFactory) Creates a newExtensionAwareEvaluationContextProvider
with extensions looked up lazily from the givenBeanFactory
.ExtensionAwareEvaluationContextProvider
(Lazy<? extends Collection<? extends ExtensionIdAware>> extensions) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.expression.spel.support.StandardEvaluationContext
getEvaluationContext
(Object rootObject) Return aEvaluationContext
built using the given parameter values.org.springframework.expression.spel.support.StandardEvaluationContext
getEvaluationContext
(Object rootObject, ExpressionDependencies dependencies) Return a tailoredEvaluationContext
built using the given parameter values and consideringexpression dependencies
.
-
Constructor Details
-
ExtensionAwareEvaluationContextProvider
public ExtensionAwareEvaluationContextProvider(org.springframework.beans.factory.ListableBeanFactory beanFactory) Creates a newExtensionAwareEvaluationContextProvider
with extensions looked up lazily from the givenBeanFactory
.- Parameters:
beanFactory
- theListableBeanFactory
to lookup extensions from.
-
ExtensionAwareEvaluationContextProvider
Creates a newExtensionAwareEvaluationContextProvider
for the givenEvaluationContextExtension
s.- Parameters:
extensions
- must not be null.
-
ExtensionAwareEvaluationContextProvider
public ExtensionAwareEvaluationContextProvider(Lazy<? extends Collection<? extends ExtensionIdAware>> extensions)
-
-
Method Details
-
getEvaluationContext
public org.springframework.expression.spel.support.StandardEvaluationContext getEvaluationContext(Object rootObject) Description copied from interface:EvaluationContextProvider
Return aEvaluationContext
built using the given parameter values.- Specified by:
getEvaluationContext
in interfaceEvaluationContextProvider
- Parameters:
rootObject
- the root object to set in theEvaluationContext
.- Returns:
-
getEvaluationContext
public org.springframework.expression.spel.support.StandardEvaluationContext getEvaluationContext(Object rootObject, ExpressionDependencies dependencies) Description copied from interface:EvaluationContextProvider
Return a tailoredEvaluationContext
built using the given parameter values and consideringexpression dependencies
. The returnedEvaluationContext
may contain a reduced visibility of methods and properties/fields according to the requiredexpression dependencies
.- Specified by:
getEvaluationContext
in interfaceEvaluationContextProvider
- Parameters:
rootObject
- the root object to set in theEvaluationContext
.dependencies
- the requested expression dependencies to be available.- Returns:
-