Previous Topic: Vendor Certification Expressions: Expression Operators, Functions, and Global VariablesNext Topic: Functions and Global Variables


Expression Operators

This section describes operators that you can use in vendor certification expressions.

You can use MVEL syntax in vendor certification expressions. MVEL is a publicly available embeddable Expression Language for Java environments that has a syntax close to Java. MVEL supports expressions similar to Java expressions.

You can build expressions using operators, use braces to control precedence, and terminate statements by semi-colons. For a detailed reference of the MVEL language, see http://mvel.codehaus.org.

The following table summarizes the available operators:

Note: In XML documents, use the XML Named Entities (XNE) presentation.

Operator

XNE

Description

Example

=

 

Assign

a = 1

==

 

Equals

"fred" == "fred"

!=

 

Not Equals

"fred" != "tom"

>

>

Greater Than

1 > 0 is true

<

&lt;

Less Than

0 < 1 is true

>=

 

Greater Than or Equal

1 >= 0 is true

<=

 

Less Than or Equal

1 <= 1 is true

contains

 

Verify if the value on the left side contains the value on the right

"tomcat" contains "cat"

isdef

 

Tests whether a variable is defined

isdef a

+

 

Add

1 + 1

+

 

Concatenate

"one " + "two"

-

 

Minus

2 - 1

*

 

Multiply

2 * 2

/

 

Divide

4 / 2

%

 

Modulus

5 % 2

&&

&amp;&amp;

Logical AND

(x>-1) && (x<1)

||

 

Logical OR

(x<-1) || (x>1)

&

&amp;

AND bit operation

17 & 0xF

|

 

OR bit operation

4 | 1

^

 

Exclusive OR bit operation

5 ^ 1

!

 

Negate

! True

?

 

Ternary operator

age > 17 ? "allow" : "deny"