Package org.springframework.data.spel
Interface EvaluationContextProvider
- All Known Subinterfaces:
ReactiveEvaluationContextProvider
- All Known Implementing Classes:
ExtensionAwareEvaluationContextProvider,ReactiveExtensionAwareEvaluationContextProvider,SpELContext
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Provides a way to access a centrally defined potentially shared
StandardEvaluationContext.- Since:
- 2.1
- Author:
- Thomas Darimont, Oliver Gierke, Christoph Strobl, Mark Paluch
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EvaluationContextProviderA simple defaultEvaluationContextProviderreturning aStandardEvaluationContextwith the given root object. -
Method Summary
Modifier and TypeMethodDescriptiongetEvaluationContext(@Nullable Object rootObject) Return aEvaluationContextbuilt using the given parameter values.default EvaluationContextgetEvaluationContext(@Nullable Object rootObject, ExpressionDependencies dependencies) Return a tailoredEvaluationContextbuilt using the given parameter values and consideringexpression dependencies.
-
Field Details
-
DEFAULT
A simple defaultEvaluationContextProviderreturning aStandardEvaluationContextwith the given root object.
-
-
Method Details
-
getEvaluationContext
Return aEvaluationContextbuilt using the given parameter values.- Parameters:
rootObject- the root object to set in theEvaluationContext.- Returns:
-
getEvaluationContext
default EvaluationContext getEvaluationContext(@Nullable Object rootObject, ExpressionDependencies dependencies) Return 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.- Parameters:
rootObject- the root object to set in theEvaluationContext.dependencies- the requested expression dependencies to be available.- Returns:
- Since:
- 2.4
-