Class ExtensionAwareQueryMethodEvaluationContextProvider
java.lang.Object
org.springframework.data.repository.query.ExtensionAwareQueryMethodEvaluationContextProvider
- All Implemented Interfaces:
QueryMethodEvaluationContextProvider
public class ExtensionAwareQueryMethodEvaluationContextProvider
extends Object
implements QueryMethodEvaluationContextProvider
An
QueryMethodEvaluationContextProvider
that assembles an EvaluationContext
from a list of
EvaluationContextExtension
instances.- Since:
- 1.9
- Author:
- Thomas Darimont, Oliver Gierke, Christoph Strobl, Jens Schauder, Johannes Englmeier
-
Field Summary
Fields inherited from interface org.springframework.data.repository.query.QueryMethodEvaluationContextProvider
DEFAULT
-
Constructor Summary
ConstructorDescriptionExtensionAwareQueryMethodEvaluationContextProvider
(List<? extends EvaluationContextExtension> extensions) Creates a newExtensionAwareQueryMethodEvaluationContextProvider
using the givenEvaluationContextExtension
s.Creates a newExtensionAwareQueryMethodEvaluationContextProvider
. -
Method Summary
Modifier and TypeMethodDescription<T extends Parameters<?,
?>>
EvaluationContextgetEvaluationContext
(T parameters, Object[] parameterValues) Returns anEvaluationContext
built using the givenParameters
and parameter values.<T extends Parameters<?,
?>>
EvaluationContextgetEvaluationContext
(T parameters, Object[] parameterValues, ExpressionDependencies dependencies) Returns anEvaluationContext
built using the givenParameters
and parameter values.
-
Constructor Details
-
ExtensionAwareQueryMethodEvaluationContextProvider
Creates a newExtensionAwareQueryMethodEvaluationContextProvider
.- Parameters:
beanFactory
- theListableBeanFactory
to lookup theEvaluationContextExtension
s from, must not be null.
-
ExtensionAwareQueryMethodEvaluationContextProvider
public ExtensionAwareQueryMethodEvaluationContextProvider(List<? extends EvaluationContextExtension> extensions) Creates a newExtensionAwareQueryMethodEvaluationContextProvider
using the givenEvaluationContextExtension
s.- Parameters:
extensions
- must not be null.
-
-
Method Details
-
getEvaluationContext
public <T extends Parameters<?,?>> EvaluationContext getEvaluationContext(T parameters, Object[] parameterValues) Description copied from interface:QueryMethodEvaluationContextProvider
Returns anEvaluationContext
built using the givenParameters
and parameter values.- Specified by:
getEvaluationContext
in interfaceQueryMethodEvaluationContextProvider
- Parameters:
parameters
- theParameters
instance obtained from the query method the context is built for.parameterValues
- the values for the parameters.- Returns:
-
getEvaluationContext
public <T extends Parameters<?,?>> EvaluationContext getEvaluationContext(T parameters, Object[] parameterValues, ExpressionDependencies dependencies) Description copied from interface:QueryMethodEvaluationContextProvider
Returns anEvaluationContext
built using the givenParameters
and parameter values.- Specified by:
getEvaluationContext
in interfaceQueryMethodEvaluationContextProvider
- Parameters:
parameters
- theParameters
instance obtained from the query method the context is built for.parameterValues
- the values for the parameters.- Returns:
-