Skip to content

Commit b00f98f

Browse files
committed
Revised SimpleEvaluationContext example
Issue: SPR-17581
1 parent 7ff1b0e commit b00f98f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/asciidoc/core-expressions.adoc

+3-4
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,10 @@ being placed in it. A simple example:
232232
Simple simple = new Simple();
233233
simple.booleanList.add(true);
234234
235-
SimpleEvaluationContext context = SimpleEvaluationContext().create();
236-
237-
// false is passed in here as a string. SpEL and the conversion service will
238-
// correctly recognize that it needs to be a Boolean and convert it
235+
EvaluationContext context = SimpleEvaluationContext.forReadOnlyDataBinding().build();
239236
237+
// "false" is passed in here as a String. SpEL and the conversion service
238+
// will recognize that it needs to be a Boolean and convert it accordingly.
240239
parser.parseExpression("booleanList[0]").setValue(context, simple, "false");
241240
242241
// b will be false

0 commit comments

Comments
 (0)