Browse Source

Improve layout for Literal Expressions section

pull/32189/head
Sam Brannen 2 years ago
parent
commit
7627d8c6fc
  1. 30
      framework-docs/modules/ROOT/pages/core/expressions/language-ref/literal.adoc

30
framework-docs/modules/ROOT/pages/core/expressions/language-ref/literal.adoc

@ -3,20 +3,22 @@ @@ -3,20 +3,22 @@
SpEL supports the following types of literal expressions.
- strings
- numeric values: integer (`int` or `long`), hexadecimal (`int` or `long`), real (`float`
or `double`)
- boolean values: `true` or `false`
- null
Strings can be delimited by single quotation marks (`'`) or double quotation marks (`"`). To
include a single quotation mark within a string literal enclosed in single quotation
marks, use two adjacent single quotation mark characters. Similarly, to include a double
quotation mark within a string literal enclosed in double quotation marks, use two
adjacent double quotation mark characters.
Numbers support the use of the negative sign, exponential notation, and decimal points.
By default, real numbers are parsed by using `Double.parseDouble()`.
String ::
Strings can be delimited by single quotation marks (`'`) or double quotation marks
(`"`). To include a single quotation mark within a string literal enclosed in single
quotation marks, use two adjacent single quotation mark characters. Similarly, to
include a double quotation mark within a string literal enclosed in double quotation
marks, use two adjacent double quotation mark characters.
Number ::
Numbers support the use of the negative sign, exponential notation, and decimal points.
* Integer: `int` or `long`
* Hexadecimal: `int` or `long`
* Real: `float` or `double`
** By default, real numbers are parsed using `Double.parseDouble()`.
Boolean ::
`true` or `false`
Null ::
`null`
The following listing shows simple usage of literals. Typically, they are not used in
isolation like this but, rather, as part of a more complex expression -- for example,

Loading…
Cancel
Save