public class SpELExpressionParameterValueProvider<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.Constructor and Description |
---|
SpELExpressionParameterValueProvider(@NonNull SpELExpressionEvaluator evaluator,
@NonNull ConversionService conversionService,
@NonNull ParameterValueProvider<P> delegate) |
Modifier and Type | Method and Description |
---|---|
<T> T |
getParameterValue(PreferredConstructor.Parameter<T,P> parameter)
Returns the value to be used for the given
PreferredConstructor.Parameter (usually when entity instances are created). |
protected <T> T |
potentiallyConvertSpelValue(Object object,
PreferredConstructor.Parameter<T,P> parameter)
Hook to allow to massage the value resulting from the Spel expression evaluation.
|
public SpELExpressionParameterValueProvider(@NonNull @NonNull SpELExpressionEvaluator evaluator, @NonNull @NonNull ConversionService conversionService, @NonNull @NonNull ParameterValueProvider<P> delegate)
@Nullable public <T> T getParameterValue(PreferredConstructor.Parameter<T,P> parameter)
ParameterValueProvider
PreferredConstructor.Parameter
(usually when entity instances are created).getParameterValue
in interface ParameterValueProvider<P extends PersistentProperty<P>>
parameter
- must not be null.@Nullable protected <T> T potentiallyConvertSpelValue(Object object, PreferredConstructor.Parameter<T,P> parameter)
ConversionService
to massage the value into the parameter type.object
- the value to massage, will never be null.parameter
- the PreferredConstructor.Parameter
we create the value forCopyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.