Revised SimpleEvaluationContext example

Issue: SPR-17581
This commit is contained in:
Juergen Hoeller
2018-12-12 12:11:15 +01:00
parent 6eb0a60df9
commit 474ac2d975

View File

@@ -239,10 +239,10 @@ being placed in it. The following example shows how to do so:
Simple simple = new Simple();
simple.booleanList.add(true);
EvaluationContext context = SimpleEvaluationContext().forReadOnlyDataBinding().build();
EvaluationContext context = SimpleEvaluationContext.forReadOnlyDataBinding().build();
// false is passed in here as a string. SpEL and the conversion service
// correctly recognize that it needs to be a Boolean and convert it
// "false" is passed in here as a String. SpEL and the conversion service
// will recognize that it needs to be a Boolean and convert it accordingly.
parser.parseExpression("booleanList[0]").setValue(context, simple, "false");
// b is false