Table of Contents
Here we describe how OGNL interprets objects as various types. See below for how OGNL coerces objects to booleans, numbers, integers, and collections.
Any object can be used where a boolean is required. OGNL interprets objects as booleans like this:
If the object is a Boolean
, its value is extracted and returned
If the object is a Number
, its double-precision floating-point value is compared with zero; non-zero is treated as true
, zero as false
.
If the object is a Character
, its boolean value is true
if and only if its char value is non-zero.
Otherwise, its boolean value is true
if and only if it is non-null
.