Expert Spring MVC and Web Flow

(Dana P.) #1
Table 9-1.Continued
Operator Types Null Safe Description
IS NULL, NULL Any Yes (true)Tests value to the left is null.
IS NOT NULL, NOT NULL Any Yes (false)Tests value to the left is not null.
HAS TEXT Any (*) Yes (false)Tests Stringvalue to the left
contains characters other than
white space, has more than 0
characters and is not null.
HAS NO TEXT Any (*) Yes (true)Tests Stringvalue to the left
contains only white-space
characters, contains no characters
or is null.
HAS LENGTH Any (*) Yes (false)Tests Stringvalue to the left is
not nulland has more than 0
characters.
HAS NO LENGTH Any (*) Yes (true)Tests Stringvalue to the left is null
or contains no characters.
IS BLANK Any (*) Yes (true)Same as HAS LENGTH.
IS NOT BLANK Any (*) Yes (false)Same as HAS NO LENGTH.
IS UPPERCASE, IS UPPER CASE, Any (*) No Tests alpha characters in String
IS UPPER value to the left are all uppercase.
IS NOT UPPERCASE, Any (*) No Tests not all alpha characters in
IS NOT UPPER CASE, Stringvalue to the left are
IS NOT UPPER uppercase.
IS LOWERCASE, IS LOWER CASE, Any (*) No Tests alpha characters in String
IS LOWER value to the left are all lowercase.
IS NOT LOWERCASE, Any (*) No Tests not all alpha characters in
IS NOT LOWER CASE, IS NOT LOWER Stringvalue to left are lowercase.
IS WORD Any (*) Yes (false)Tests Stringvalue to the left
contains no white-space
characters.
IS NOT WORD Any (*) Yes (true)Tests Stringvalue to the left
contains and least one white-space
character.

N = number
D = date
* = takes value of the toString()method

Valang can test any value—either String, number, Boolean, and date literals or property
values of any type. See Listing 9-9.

Listing 9-9.Examples of Literal Values in Valang

'a string example, next is a number example and after that a date example'
-10.5
[2005-07-30]

270 CHAPTER 9 ■VALIDATION

Free download pdf