Class CachingValueExpressionEvaluatorFactory
java.lang.Object
org.springframework.data.mapping.model.CachingValueExpressionEvaluatorFactory
- All Implemented Interfaces:
ValueEvaluationContextProvider
public class CachingValueExpressionEvaluatorFactory
extends Object
implements ValueEvaluationContextProvider
Factory to create a ValueExpressionEvaluator
- Since:
- 3.3
- Author:
- Mark Paluch
-
Constructor Summary
ConstructorDescriptionCachingValueExpressionEvaluatorFactory
(ExpressionParser expressionParser, EnvironmentCapable environmentProvider, EvaluationContextProvider evaluationContextProvider) CachingValueExpressionEvaluatorFactory
(ExpressionParser expressionParser, EnvironmentCapable environmentProvider, EvaluationContextProvider evaluationContextProvider, int cacheSize) -
Method Summary
Modifier and TypeMethodDescriptionCreates a newValueExpressionEvaluator
using the givensource
as root object.getEvaluationContext
(Object rootObject) Return aEvaluationContext
built using the given parameter values.getEvaluationContext
(Object rootObject, ExpressionDependencies dependencies) Return a tailoredEvaluationContext
built using the given parameter values and consideringexpression dependencies
.
-
Constructor Details
-
CachingValueExpressionEvaluatorFactory
public CachingValueExpressionEvaluatorFactory(ExpressionParser expressionParser, EnvironmentCapable environmentProvider, EvaluationContextProvider evaluationContextProvider) -
CachingValueExpressionEvaluatorFactory
public CachingValueExpressionEvaluatorFactory(ExpressionParser expressionParser, EnvironmentCapable environmentProvider, EvaluationContextProvider evaluationContextProvider, int cacheSize)
-
-
Method Details
-
getEvaluationContext
Description copied from interface:ValueEvaluationContextProvider
Return aEvaluationContext
built using the given parameter values.- Specified by:
getEvaluationContext
in interfaceValueEvaluationContextProvider
- Parameters:
rootObject
- the root object to set in theEvaluationContext
.- Returns:
-
getEvaluationContext
public ValueEvaluationContext getEvaluationContext(Object rootObject, ExpressionDependencies dependencies) Description copied from interface:ValueEvaluationContextProvider
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 interfaceValueEvaluationContextProvider
- Parameters:
rootObject
- the root object to set in theEvaluationContext
.dependencies
- the requested expression dependencies to be available.- Returns:
-
create
Creates a newValueExpressionEvaluator
using the givensource
as root object.- Parameters:
source
- the root object for evaluating the expression.- Returns:
- a new
ValueExpressionEvaluator
to evaluate the expression in the context of the givensource
object.
-