|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zel.impl.lang.ELSupport
public class ELSupport
A helper class that implements the EL Specification
| Field Summary | |
|---|---|
protected static boolean |
COERCE_NULL_TO_NULL
EL 2.2 by spec. should coerce "null" value to 0 number, 0 character, "" String, false boolean. |
| Constructor Summary | |
|---|---|
ELSupport()
|
|
| Method Summary | |
|---|---|
static Boolean |
coerceToBoolean(Object obj)
Convert an object to Boolean. |
static Character |
coerceToCharacter(Object obj)
|
static Date |
coerceToDateTime(Object obj,
Class type)
Coerce an object to an instance of java.util.Date |
static Enum<?> |
coerceToEnum(Object obj,
Class type)
|
protected static Number |
coerceToNumber(Number number,
Class<?> type)
|
static Number |
coerceToNumber(Object obj,
Class<?> type)
|
protected static Number |
coerceToNumber(String val,
Class<?> type)
|
static String |
coerceToString(Object obj)
Coerce an object to a string |
static Object |
coerceToType(Object obj,
Class<?> type)
|
protected static Object |
coerceToTypeForSetValue(Object obj,
Class<?> type)
|
static int |
compare(Object obj0,
Object obj1)
Compare two objects, after coercing to the same type if appropriate. |
static boolean |
equals(Object obj0,
Object obj1)
Compare two objects for equality, after coercing to the same type if appropriate. |
static boolean |
isBigDecimalOp(Object obj0,
Object obj1)
|
static boolean |
isBigIntegerOp(Object obj0,
Object obj1)
|
static boolean |
isDateTimeType(Class<?> type)
|
static boolean |
isDoubleOp(Object obj0,
Object obj1)
|
static boolean |
isLongOp(Object obj0,
Object obj1)
|
static boolean |
isStringFloat(String str)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final boolean COERCE_NULL_TO_NULL
| Constructor Detail |
|---|
public ELSupport()
| Method Detail |
|---|
public static final int compare(Object obj0,
Object obj1)
throws ELException
equals(Object, Object) then return 0.
If either object is a BigDecimal, then coerce both to BigDecimal first.
Similarly for Double(Float), BigInteger, and Long(Integer, Char, Short, Byte).
Otherwise, check that the first object is an instance of Comparable, and compare
against the second object. If that is null, return 1, otherwise
return the result of comparing against the second object.
Similarly, if the second object is Comparable, if the first is null, return -1,
else return the result of comparing against the first object.
A null object is considered as:
obj0 - first objectobj1 - second object
ELException - if neither object is Comparable
ClassCastException - if the objects are not mutually comparable
public static final boolean equals(Object obj0,
Object obj1)
throws ELException
obj0 - the first objectobj1 - the second object
ELException
public static final Enum<?> coerceToEnum(Object obj,
Class type)
public static final Boolean coerceToBoolean(Object obj)
throws ELException
obj - the object to convert
ELException - if object is not Boolean or String
public static final Character coerceToCharacter(Object obj)
throws ELException
ELException
protected static final Number coerceToNumber(Number number,
Class<?> type)
throws ELException
ELException
public static final Number coerceToNumber(Object obj,
Class<?> type)
throws ELException
ELException
protected static final Number coerceToNumber(String val,
Class<?> type)
throws ELException
ELExceptionpublic static final String coerceToString(Object obj)
obj -
protected static final Object coerceToTypeForSetValue(Object obj,
Class<?> type)
throws ELException
ELException
public static final Object coerceToType(Object obj,
Class<?> type)
throws ELException
ELException
public static final boolean isBigDecimalOp(Object obj0,
Object obj1)
public static final boolean isBigIntegerOp(Object obj0,
Object obj1)
public static final boolean isDoubleOp(Object obj0,
Object obj1)
public static final boolean isLongOp(Object obj0,
Object obj1)
public static final boolean isStringFloat(String str)
public static final boolean isDateTimeType(Class<?> type)
public static final Date coerceToDateTime(Object obj,
Class type)
throws ELException
obj - the object to be converted; must be an instance of java.util.Date or
a number which represents the millisecond since "the epoch" base time, namely January 1, 1970, 00:00:00 GMT.type - the class type which shall be a kind of java.util.Date; e.g. java.sql.Date, java.sql.Time, java.sql.Timestamp
ELException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||