| Operator |
getValue() Notes |
setValue() Notes |
|
Sequence operator |
Both e1 and e2 are evaluated with the same source object, and the result of e2 is returned. |
getValue is called on e1, and then setValue is called on e2. |
|
Assignment operator |
getValue is called on e2, and then setValue is called on e1 with the result of e2 as the target object. |
Cannot be the top-level expression for setValue. |
|
Conditional operator |
getValue is called on e1 and the result is interpreted as a boolean. getValue is then called on either e2 or e3, depending on whether the result of e1 was true or false respectively, and the result is returned. |
getValue is called on e1, and then setValue is called on either e2 or e3. |
|
Logical or operator |
getValue is called on e1 and the result is interpreted as a boolean. If true, that result is returned; if false, getValue is called on e2 and its value is returned. |
getValue is called on e1; if false, setValue is called on e2. Note that e1 being true prevents any further setting from taking place. |
|
Logical and operator |
getValue is called on e1 and the result is interpreted as a boolean. If false, that result is returned; if true, getValue is called on e2 and its value is returned. |
getValue is called on e1; if true, setValue is called on e2. Note that e1 being false prevents any further setting from taking place. |
|
Bitwise or operator |
e1 and e2 are interpreted as integers and the result is an integer. |
Cannot be the top-level expression passed to setValue. |
|
Bitwise exclusive-or operator |
e1 and e2 are interpreted as integers and the result is an integer. |
Cannot be the top-level expression passed to setValue. |
|
Bitwise and operator |
e1 and e2 are interpreted as integers and the result is an integer. |
Cannot be the top-level expression passed to setValue. |
|
Equality test
Inequality test |
Equality is tested for as follows. If either value is null, they are equal if and only if both are null. If they are the same object or the equals() method says they are equal, they are equal. If they are both Numbers, they are equal if their values as double-precision floating point numbers are equal. Otherwise, they are not equal. These rules make numbers compare equal more readily than they would normally, if just using the equals method. |
Cannot be the top-level expression passed to setValue. |
|
Less than comparison
Less than or equals comparison
Greater than comparison
Greater than or equals comparison
List membership comparison
List non-membership comparison |
The ordering operators compare with compareTo() if their arguments are non-numeric and implement Comparable; otherwise, the arguments are interpreted as numbers and compared numerically. The in operator is not from Java; it tests for inclusion of e1 in e2, where e2 is interpreted as a collection. This test is not efficient: it iterates the collection. However, it uses the standard OGNL equality test. |
Cannot be the top-level expression passed to setValue. |
|
Bit shift left
Bit shift right
Logical shift right |
e1 and e2 are interpreted as integers and the result is an integer. |
Cannot be the top-level expression passed to setValue. |
|
Addition
Subtraction |
The plus operator concatenates strings if its arguments are non-numeric; otherwise it interprets its arguments as numbers and adds them. The minus operator always works on numbers. |
Cannot be the top-level expression passed to setValue. |
|
Multiplication
Division
Remainder |
Multiplication, division, which interpret their arguments as numbers, and remainder, which interprets its arguments as integers. |
Cannot be the top-level expression passed to setValue. |
|
Unary plus
Unary minus
Logical not
Bitwise not
Class membership |
Unary plus is a no-op, it simply returns the value of its argument. Unary minus interprets its argument as a number. Logical not interprets its argument as a boolean. Bitwise not interprets its argument as an integer. The class argument to instanceof is the fully qualified name of a Java class. |
Cannot be the top-level expression passed to setValue. |
|
Method call
Property
Index
Projection
Selection
Subexpression evaluation
Expression evaluation |
Generally speaking, navigation chains are evaluated by evaluating the first expression, then evaluating the second one with the result of the first as the source object. |
Some of these forms can be passed as top-level expressions to setValue and others cannot. Only those chains that end in property references (e.property), indexes (e1[e2]), and subexpressions (e1.(e2)) can be; and expression evaluations can be as well. For the chains, getValue is called on the left-hand expression (e or e1), and then setValue is called on the rest with the result as the target object. |
constant
Constant
Parenthesized expression
Method call
Property reference
Index reference
List creation
Context variable reference
Static method reference
Static field reference
Constructor call
new array-component-class[] { e, ... }
Array creation
Map creation
#@classname@{ e1 : e2, ... }
Map creation with specific subclass
Lambda expression definition |
Basic expressions |
Only property references (property), indexes ([e]), and variable references (#variable) can be passed as top-level expressions to setValue. For indexes, getValue is called on e, and then the result is used as the property "name" (which might be a String or any other kind of object) to set in the current target object. Variable and property references are set more directly. |