Class ValueExpressionDelegate
java.lang.Object
org.springframework.data.repository.query.ValueExpressionDelegate
- All Implemented Interfaces:
ValueExpressionParser
- Direct Known Subclasses:
CachingValueExpressionDelegate
Delegate to provide a
ValueExpressionParser
along with a context factory.
Subclasses can customize parsing behavior.
- Author:
- Mark Paluch
-
Constructor Summary
ConstructorDescriptionValueExpressionDelegate
(QueryMethodValueEvaluationContextAccessor contextAccessor, ValueExpressionParser valueExpressionParser) Creates a newValueExpressionDelegate
givenQueryMethodValueEvaluationContextAccessor
andValueExpressionParser
. -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueExpressionDelegate
create()
Creates a defaultValueExpressionDelegate
using theStandardEnvironment
, a defaultValueExpression
and extension-lessEvaluationContextProvider
.createValueContextProvider
(Parameters<?, ?> parameters) Creates aValueEvaluationContextProvider
for query methodParameters
for later creation of aValueEvaluationContext
based on the actual method parameter values.Parses the expression string and return an Expression object you can use for repeated evaluation.
-
Constructor Details
-
ValueExpressionDelegate
public ValueExpressionDelegate(QueryMethodValueEvaluationContextAccessor contextAccessor, ValueExpressionParser valueExpressionParser) Creates a newValueExpressionDelegate
givenQueryMethodValueEvaluationContextAccessor
andValueExpressionParser
.- Parameters:
contextAccessor
- the factory to create value evaluation context providers, must not benull
.valueExpressionParser
- the parser to parse expression strings into value expressions, must not benull
.
-
-
Method Details
-
create
Creates a defaultValueExpressionDelegate
using theStandardEnvironment
, a defaultValueExpression
and extension-lessEvaluationContextProvider
.- Returns:
- a default
ValueExpressionDelegate
.
-
getValueExpressionParser
-
getEvaluationContextAccessor
-
createValueContextProvider
Creates aValueEvaluationContextProvider
for query methodParameters
for later creation of aValueEvaluationContext
based on the actual method parameter values. The resultingValueEvaluationContextProvider
is only valid for the given parameters- Parameters:
parameters
- the query method parameters to use.- Returns:
-
parse
Description copied from interface:ValueExpressionParser
Parses the expression string and return an Expression object you can use for repeated evaluation.Some examples:
#{3 + 4} #{name.firstName} ${key.one} #{name.lastName}-${key.one}
- Specified by:
parse
in interfaceValueExpressionParser
- Parameters:
expressionString
- the raw expression string to parse.- Returns:
- an evaluator for the parsed expression.
- Throws:
ParseException
- an exception occurred during parsing.
-