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
ConstructorsConstructorDescriptionExtensionAwareEvaluationContextProvider(Collection<? extends ExtensionIdAware> extensions) Creates a newExtensionAwareEvaluationContextProviderfor the givenEvaluationContextExtensions.ExtensionAwareEvaluationContextProvider(org.springframework.beans.factory.ListableBeanFactory beanFactory) Creates a newExtensionAwareEvaluationContextProviderwith extensions looked up lazily from the givenBeanFactory.ExtensionAwareEvaluationContextProvider(Lazy<? extends Collection<? extends ExtensionIdAware>> extensions) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.expression.spel.support.StandardEvaluationContextgetEvaluationContext(Object rootObject) Return aEvaluationContextbuilt using the given parameter values.org.springframework.expression.spel.support.StandardEvaluationContextgetEvaluationContext(Object rootObject, ExpressionDependencies dependencies) Return a tailoredEvaluationContextbuilt using the given parameter values and consideringexpression dependencies.
-
Constructor Details
-
ExtensionAwareEvaluationContextProvider
public ExtensionAwareEvaluationContextProvider(org.springframework.beans.factory.ListableBeanFactory beanFactory) Creates a newExtensionAwareEvaluationContextProviderwith extensions looked up lazily from the givenBeanFactory.- Parameters:
beanFactory- theListableBeanFactoryto lookup extensions from.
-
ExtensionAwareEvaluationContextProvider
Creates a newExtensionAwareEvaluationContextProviderfor the givenEvaluationContextExtensions.- 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:EvaluationContextProviderReturn aEvaluationContextbuilt using the given parameter values.- Specified by:
getEvaluationContextin 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:EvaluationContextProviderReturn a tailoredEvaluationContextbuilt using the given parameter values and consideringexpression dependencies. The returnedEvaluationContextmay contain a reduced visibility of methods and properties/fields according to the requiredexpression dependencies.- Specified by:
getEvaluationContextin interfaceEvaluationContextProvider- Parameters:
rootObject- the root object to set in theEvaluationContext.dependencies- the requested expression dependencies to be available.- Returns:
-