doc-exports/docs/dataartsstudio/umn/dataartsstudio_01_0495.html
Xiong, Chen Xiao f3ee29a3dd DataArts UMN 20230329 version
Reviewed-by: Rechenburg, Matthias <matthias.rechenburg@t-systems.com>
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Xiong, Chen Xiao <chenxiaoxiong@huawei.com>
Co-committed-by: Xiong, Chen Xiao <chenxiaoxiong@huawei.com>
2023-05-11 17:09:25 +00:00

10 KiB

Basic Operators

EL supports most of the arithmetic and logic operators provided by Java.

Operator List

Table 1 Basic operators

Operator

Description

.

Accesses a Bean property or a mapping entry.

[]

Accesses an array or linked list.

()

Organizes a subexpression to change priority.

+

Plus sign

-

Minus or negative sign

*

Multiplication sign

/ or div

Division sign

% or mod

Modulo

== or eq

Test whether equal to.

!= or ne

Test whether unequal to.

< or lt

Test whether less than.

> or gt

Test whether greater than.

<= or le

Check whether less than or equal to.

>= or ge

Test whether greater than or equal to.

&& or and

Test logic and.

|| or or

Test logic or.

! or not

Test negation.

empty

Test whether empty.

?:

The expression is similar to if else. If the statement in front of ? is true, the value of the expression between ? and : is returned. Otherwise, the value following : is returned.

Example

If variable a is empty, default is returned. If variable a is not empty, a itself is returned. The EL expression is as follows:

#{empty a?"default":a}