19
19
import java .util .function .Function ;
20
20
import java .util .function .Supplier ;
21
21
22
+ import org .springframework .data .mapping .model .SpELExpressionEvaluator ;
22
23
import org .springframework .data .mapping .model .ValueExpressionEvaluator ;
23
24
import org .springframework .data .spel .ExpressionDependencies ;
24
25
import org .springframework .data .util .Lazy ;
@@ -45,7 +46,9 @@ public class ParameterBindingContext {
45
46
* @param valueProvider
46
47
* @param expressionParser
47
48
* @param evaluationContext
49
+ * @deprecated since 4.3, use {@link #ParameterBindingContext(ValueProvider, ExpressionParser, Supplier)} instead.
48
50
*/
51
+ @ Deprecated (since = "4.3" )
49
52
public ParameterBindingContext (ValueProvider valueProvider , SpelExpressionParser expressionParser ,
50
53
EvaluationContext evaluationContext ) {
51
54
this (valueProvider , expressionParser , () -> evaluationContext );
@@ -59,13 +62,29 @@ public ParameterBindingContext(ValueProvider valueProvider, SpelExpressionParser
59
62
*/
60
63
public ParameterBindingContext (ValueProvider valueProvider , ExpressionParser expressionParser ,
61
64
Supplier <EvaluationContext > evaluationContext ) {
62
- this (valueProvider , new EvaluationContextExpressionEvaluator (valueProvider , expressionParser , evaluationContext ));
65
+ this (valueProvider , new EvaluationContextExpressionEvaluator (valueProvider , expressionParser ) {
66
+ @ Override
67
+ public EvaluationContext getEvaluationContext (String expressionString ) {
68
+ return evaluationContext .get ();
69
+ }
70
+ });
63
71
}
64
72
65
73
/**
66
74
* @param valueProvider
67
75
* @param expressionEvaluator
68
76
* @since 3.1
77
+ * @deprecated since 4.3, use {@link #ParameterBindingContext(ValueProvider, ValueExpressionEvaluator)} instead.
78
+ */
79
+ @ Deprecated (since = "4.3" )
80
+ public ParameterBindingContext (ValueProvider valueProvider , SpELExpressionEvaluator expressionEvaluator ) {
81
+ this (valueProvider , (ValueExpressionEvaluator ) expressionEvaluator );
82
+ }
83
+
84
+ /**
85
+ * @param valueProvider
86
+ * @param expressionEvaluator
87
+ * @since 4.3
69
88
*/
70
89
public ParameterBindingContext (ValueProvider valueProvider , ValueExpressionEvaluator expressionEvaluator ) {
71
90
this .valueProvider = valueProvider ;
@@ -86,7 +105,7 @@ public static ParameterBindingContext forExpressions(ValueProvider valueProvider
86
105
Function <ExpressionDependencies , EvaluationContext > contextFunction ) {
87
106
88
107
return new ParameterBindingContext (valueProvider ,
89
- new EvaluationContextExpressionEvaluator (valueProvider , expressionParser , null ) {
108
+ new EvaluationContextExpressionEvaluator (valueProvider , expressionParser ) {
90
109
91
110
@ Override
92
111
public EvaluationContext getEvaluationContext (String expressionString ) {
0 commit comments