Class ValueExpressionParameterValueProvider<P extends PersistentProperty<P>>
java.lang.Object
org.springframework.data.mapping.model.ValueExpressionParameterValueProvider<P>
- All Implemented Interfaces:
- ParameterValueProvider<P>
- Direct Known Subclasses:
- SpELExpressionParameterValueProvider
public class ValueExpressionParameterValueProvider<P extends PersistentProperty<P>>
extends Object
implements ParameterValueProvider<P>
ParameterValueProvider that can be used to front a ParameterValueProvider delegate to prefer a SpEL
 expression evaluation over directly resolving the parameter value with the delegate.- Since:
- 3.3
- Author:
- Oliver Gierke, Mark Paluch
- 
Constructor SummaryConstructorsConstructorDescriptionValueExpressionParameterValueProvider(ValueExpressionEvaluator evaluator, ConversionService conversionService, ParameterValueProvider<P> delegate) 
- 
Method SummaryModifier and TypeMethodDescription<T> TgetParameterValue(Parameter<T, P> parameter) Returns the value to be used for the givenParameter(usually when entity instances are created).protected <T> TpotentiallyConvertExpressionValue(Object object, Parameter<T, P> parameter) Hook to allow to massage the value resulting from the Spel expression evaluation.protected <T> TpotentiallyConvertSpelValue(Object object, Parameter<T, P> parameter) Deprecated.
- 
Constructor Details- 
ValueExpressionParameterValueProviderpublic ValueExpressionParameterValueProvider(ValueExpressionEvaluator evaluator, ConversionService conversionService, ParameterValueProvider<P> delegate) 
 
- 
- 
Method Details- 
getParameterValueDescription copied from interface:ParameterValueProviderReturns the value to be used for the givenParameter(usually when entity instances are created).- Specified by:
- getParameterValuein interface- ParameterValueProvider<P extends PersistentProperty<P>>
- Parameters:
- parameter- must not be null.
- Returns:
 
- 
potentiallyConvertSpelValue@Nullable @Deprecated(since="3.3") protected <T> T potentiallyConvertSpelValue(Object object, Parameter<T, P> parameter) Deprecated.since 3.3, usepotentiallyConvertExpressionValue(Object, Parameter)instead.Hook to allow to massage the value resulting from the Spel expression evaluation. Default implementation will leverage the configuredConversionServiceto massage the value into the parameter type.- Parameters:
- object- the value to massage, will never be null.
- parameter- the- Parameterwe create the value for
- Returns:
- the converted parameter value.
 
- 
potentiallyConvertExpressionValue@Nullable protected <T> T potentiallyConvertExpressionValue(Object object, Parameter<T, P> parameter) Hook to allow to massage the value resulting from the Spel expression evaluation. Default implementation will leverage the configuredConversionServiceto massage the value into the parameter type.- Parameters:
- object- the value to massage, will never be null.
- parameter- the- Parameterwe create the value for
- Returns:
- the converted parameter value.
- Since:
- 3.3
 
 
- 
potentiallyConvertExpressionValue(Object, Parameter)instead.