Browse Source

Polish SpEL documentation

Issue: SPR-14243
pull/1067/head
Stephane Nicoll 9 years ago
parent
commit
917948deac
  1. 9
      src/asciidoc/core-expressions.adoc

9
src/asciidoc/core-expressions.adoc

@ -785,7 +785,7 @@ expression based `matches` operator. @@ -785,7 +785,7 @@ expression based `matches` operator.
----
// evaluates to false
boolean falseValue = parser.parseExpression(
"'xyz' instanceof T(int)").getValue(Boolean.class);
"'xyz' instanceof T(Integer.class)").getValue(Boolean.class);
// evaluates to true
boolean trueValue = parser.parseExpression(
@ -796,6 +796,13 @@ expression based `matches` operator. @@ -796,6 +796,13 @@ expression based `matches` operator.
"'5.0067' matches '\^-?\\d+(\\.\\d{2})?$'").getValue(Boolean.class);
----
[NOTE]
====
Be careful with primitive types as they are immediately boxed up to the wrapper type,
so `1 instanceof T(int)` evaluates to `false` while `1 instanceof T(Integer.class)`
evaluates to `true`, as expected.
====
Each symbolic operator can also be specified as a purely alphabetic equivalent. This
avoids problems where the symbols used have special meaning for the document type in
which the expression is embedded (eg. an XML document). The textual equivalents are

Loading…
Cancel
Save