Using Computed Fields
Syntax
Unified expression language syntax is used for the formulae of field values. The expression language defines the following literals:
• Boolean: true and false
• Integer: as in Java
• Floating point: as in Java
• String: with single and double quotes; " is escaped as \", ' is escaped as \', and \ is escaped as \\.
• Null: null
In addition to the . and [] operators, the expression language provides the following operators:
• Arithmetic: +, - (binary), *, / and div, % and mod, - (unary)
• Logical: and, &&, or,||, not, !
• Relational: ==, eq, !=, ne, <, lt, >, gt, <=, ge, >=, le. Comparisons can be made against other values, or against boolean, string, integer, or floating point literals.
• Empty: the empty operator is a prefix operation that can be used to determine whether a value is null or empty.
• Conditional: A ? B : C. Evaluate B or C, depending on the result of the evaluation of A.
• Projection: .{alias|expression} is a special operator on collections that iterates over the collection and creates a new collection by evaluating the specified expression or subexpression for each element alias of the original collection.
The precedence of operators in descending order and from left to right is the following:
• [] .
• () - Used to change the precedence of operators.
• - (unary) not ! empty
• * / div % mod
• + - (binary)
• < > <= >= lt gt le ge
• == != eq ne
• && and
• || or
• ? :
The following words are reserved for the JavaServer Page expression language and should not be used as identifiers.
• and
• div
• empty
• eq
• false
• ge
• gt
• instanceof
• le
• lt
• mod
• ne
• not
• null
• or
• true