This reference is split up into the following sections:
For more technical information about the JEXL Grammar, you can find the JavaCC grammar for JEXL here: Parser.jj
| Item | Description | 
|---|---|
| Comments | Specified using ##and extend to the end of line, e.g.## This is a comment | 
| Identifiers / variables | Must start with a-z,A-Z,_or$.
            Can then be followed by0-9,a-z,A-Z,_or$.
            e.g.
 
              JEXL also supports  my.dotted.var NOTE: JEXL does not support variables with hyphens in them, e.g. commons-logging loggingfrom the variablecommons | 
| Scripts | A script in Jexl is made up of zero or more statements. Scripts can be read from a String, File or URL. | 
| Statements | A statement can be the empty statement, the semicolon ( ;) ,  block, assignment or an expression.
            Statements are optionally terminated with a semicolon. | 
| Block | A block is simply multiple statements inside curly braces ( {, }). | 
| Item | Description | 
|---|---|
| Integer Literals | 1 or more digits from 0to9 | 
| Floating point Literals | 1 or more digits from 0to9, followed
            by a decimal point and then one or more digits from0to9. | 
| String literals | Can start and end with either 'or", e.g."Hello world" 'Hello world' | 
| Boolean literals | The literals trueandfalsecan be used, e.g.val1 == true | 
| Null literal | The null value is represented as in java using the literal null, e.g.val1 == null | 
| Function | Description | 
|---|---|
| empty | Returns true if the expression following is either: 
 empty(var1) | 
| size | Returns the information about the expression: 
 size("Hello") | 
| Operator | Description | 
|---|---|
| Boolean and | The usual &&operator can be used as well as the wordand, e.g.cond1 and cond2 cond1 && cond2 | 
| Boolean or | The usual ||operator can be used as well as the wordor, e.g.cond1 or cond2 cond1 || cond2 | 
| Boolean not | The usual !operator can be used as well as the wordnot, e.g.!cond1 not cond1 | 
| Bitwise and | The usual &operator is used, e.g.33 & 4 | 
| Bitwise or | The usual |operator is used, e.g.33 | 4 | 
| Bitwise xor | The usual ^operator is used, e.g.33 ^ 4 | 
| Bitwise complement | The usual ~operator is used, e.g.~33 | 
| Equality | The usual ==operator can be used as well as the abbreviationeq.
            For exampleval1 == val2 val1 eq val2 
 | 
| Inequality | The usual !=operator can be used as well as the abbreviationne.
            For exampleval1 != val2 val1 ne val2 | 
| Less Than | The usual <operator can be used as well as the abbreviationlt.
            For exampleval1 < val2 val1 lt val2 | 
| Less Than Or Equal To | The usual <=operator can be used as well as the abbreviationle.
            For exampleval1 <= val2 val1 le val2 | 
| Greater Than | The usual >operator can be used as well as the abbreviationgt.
            For exampleval1 > val2 val1 gt val2 | 
| Greater Than Or Equal To | The usual >=operator can be used as well as the abbreviationge.
            For exampleval1 >= val2 val1 ge val2 | 
| Addition | The usual +operator is used.
            For exampleval1 + val2 | 
| Subtraction | The usual -operator is used.
            For exampleval1 - val2 | 
| Multiplication | The usual *operator is used.
            For exampleval1 * val2 | 
| Division | The usual /operator is used.
            For exampleval1 / val2 | 
| Integer Division | The divoperator is used.
            For example4 div 3 | 
| Modulus (or remainder) | The %operator is used. An alternative is themodoperator.
            For example5 mod 2 5 % 2 | 
| Negation | The unary -operator is used.
            For example-12 | 
| Array access | Array elements may be accessed using either square brackets or a dotted numeral, e.g. arr1[0] arr1.0 | 
| Operator | Description | 
|---|---|
| if | Classic, if/else statement, e.g. if ((x * 2) == 5) {y = 1;} else {y = 2;} | 
| foreach | Loop through items of an Array, Collection, Map, Iterator or Enumeration, e.g. foreach (item in list) { x = x + item; }Whereitemandlistare variables. | 
| while | Loop until a condition is satisfied, e.g. while (x lt 10) { x = x + 2; } |