@ -517,7 +517,7 @@ kinds of expression cannot be compiled at the moment:
@@ -517,7 +517,7 @@ kinds of expression cannot be compiled at the moment:
* Expressions using custom resolvers or accessors
* Expressions using selection or projection
More types of expression will be compilable in the future.
More types of expressions will be compilable in the future.
@ -589,7 +589,7 @@ You can also refer to other bean properties by name, as the following example sh
@@ -589,7 +589,7 @@ You can also refer to other bean properties by name, as the following example sh
To specify a default value, you can place the `@Value` annotation on fields, methods,
and method or constructor parameters.
The following example sets the default value of a field variable:
The following example sets the default value of a field:
@ -788,7 +788,7 @@ using a literal on one side of a logical comparison operator.
@@ -788,7 +788,7 @@ using a literal on one side of a logical comparison operator.
----
Numbers support the use of the negative sign, exponential notation, and decimal points.
By default, real numbers are parsed by using Double.parseDouble().
By default, real numbers are parsed by using `Double.parseDouble()`.
@ -796,10 +796,10 @@ By default, real numbers are parsed by using Double.parseDouble().
@@ -796,10 +796,10 @@ By default, real numbers are parsed by using Double.parseDouble().
=== Properties, Arrays, Lists, Maps, and Indexers
Navigating with property references is easy. To do so, use a period to indicate a nested
property value. The instances of the `Inventor` class, `pupin` and `tesla`, were populated with
data listed in the <<expressions-example-classes, Classes used in the examples>> section.
To navigate "`down`" and get Tesla's year of birth and Pupin's city of birth, we use the following
expressions:
property value. The instances of the `Inventor` class, `pupin` and `tesla`, were
populated with data listed in the <<expressions-example-classes, Classes used in the
examples>> section. To navigate "down" the object graph and get Tesla's year of birth and
Pupin's city of birth, we use the following expressions:
@ -939,7 +939,7 @@ You can directly express lists in an expression by using `{}` notation.
@@ -939,7 +939,7 @@ You can directly express lists in an expression by using `{}` notation.
----
`{}` by itself means an empty list. For performance reasons, if the list is itself
entirely composed of fixed literals, a constant list is created to represent the
entirely composed of fixed literals, a constant list is created to represent the
expression (rather than building a new list on each evaluation).
@ -967,10 +967,11 @@ following example shows how to do so:
@@ -967,10 +967,11 @@ following example shows how to do so:
val mapOfMaps = parser.parseExpression("{name:{first:'Nikola',last:'Tesla'},dob:{day:10,month:'July',year:1856}}").getValue(context) as Map<*, *>
----
`{:}` by itself means an empty map. For performance reasons, if the map is itself composed
of fixed literals or other nested constant structures (lists or maps), a constant map is created
to represent the expression (rather than building a new map on each evaluation). Quoting of the map keys
is optional. The examples above do not use quoted keys.
`{:}` by itself means an empty map. For performance reasons, if the map is itself
composed of fixed literals or other nested constant structures (lists or maps), a
constant map is created to represent the expression (rather than building a new map on
each evaluation). Quoting of the map keys is optional (unless the key contains a period
(`.`)). The examples above do not use quoted keys.
@ -1003,8 +1004,7 @@ to have the array populated at construction time. The following example shows ho
@@ -1003,8 +1004,7 @@ to have the array populated at construction time. The following example shows ho
val numbers3 = parser.parseExpression("new int[4][5]").getValue(context) as Array<IntArray>
----
You cannot currently supply an initializer when you construct
multi-dimensional array.
You cannot currently supply an initializer when you construct a multi-dimensional array.
@ -1105,7 +1105,7 @@ expression-based `matches` operator. The following listing shows examples of bot
@@ -1105,7 +1105,7 @@ expression-based `matches` operator. The following listing shows examples of bot
@ -1120,14 +1120,14 @@ expression-based `matches` operator. The following listing shows examples of bot
@@ -1120,14 +1120,14 @@ expression-based `matches` operator. The following listing shows examples of bot
@ -1222,10 +1222,11 @@ The following example shows how to use the logical operators
@@ -1222,10 +1222,11 @@ The following example shows how to use the logical operators
[[expressions-operators-mathematical]]
==== Mathematical Operators
You can use the addition operator on both numbers and strings. You can use the subtraction, multiplication,
and division operators only on numbers. You can also use
the modulus (%) and exponential power (^) operators. Standard operator precedence is enforced. The
following example shows the mathematical operators in use:
You can use the addition operator (`+`) on both numbers and strings. You can use the
subtraction (`-`), multiplication (`*`), and division (`/`) operators only on numbers.
You can also use the modulus (`%`) and exponential power (`^`) operators on numbers.
Standard operator precedence is enforced. The following example shows the mathematical
@ -1296,9 +1297,9 @@ following example shows the mathematical operators in use:
@@ -1296,9 +1297,9 @@ following example shows the mathematical operators in use:
[[expressions-assignment]]
==== The Assignment Operator
To setting a property, use the assignment operator (`=`). This is typically
done within a call to `setValue` but can also be done inside a call to `getValue`. The
following listing shows both ways to use the assignment operator:
To set a property, use the assignment operator (`=`). This is typically done within a
call to `setValue` but can also be done inside a call to `getValue`. The following
listing shows both ways to use the assignment operator:
@ -1333,9 +1334,9 @@ You can use the special `T` operator to specify an instance of `java.lang.Class`
@@ -1333,9 +1334,9 @@ You can use the special `T` operator to specify an instance of `java.lang.Class`
type). Static methods are invoked by using this operator as well. The
`StandardEvaluationContext` uses a `TypeLocator` to find types, and the
`StandardTypeLocator` (which can be replaced) is built with an understanding of the
`java.lang` package. This means that `T()` references to types within `java.lang` do not need to be
fully qualified, but all other type references must be. The following example shows how
to use the `T` operator:
`java.lang` package. This means that `T()` references to types within the `java.lang`
package do not need to be fully qualified, but all other type references must be. The
following example shows how to use the `T` operator:
@ -1376,7 +1378,7 @@ example shows how to use the `new` operator to invoke constructors:
@@ -1376,7 +1378,7 @@ example shows how to use the `new` operator to invoke constructors:
"new org.spring.samples.spel.inventor.Inventor('Albert Einstein', 'German')")
.getValue(Inventor.class);
//create new inventor instance within add method of List
// create new Inventor instance within the add() method of List
@ -1388,7 +1390,7 @@ example shows how to use the `new` operator to invoke constructors:
@@ -1388,7 +1390,7 @@ example shows how to use the `new` operator to invoke constructors:
"new org.spring.samples.spel.inventor.Inventor('Albert Einstein', 'German')")
.getValue(Inventor::class.java)
//create new inventor instance within add method of List
// create new Inventor instance within the add() method of List