org.apache.commons.jexl.util
Class  Coercion
java.lang.Object
  |
  +--org.apache.commons.jexl.util.Coercion
- public class Coercion- extends Object
Coercion utilities for the JSTL EL-like coercion.
- Since: 
- 1.0
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
Coercion
public Coercion()
coerceBoolean
public static Boolean coerceBoolean(Object val)
- Coerce to a Boolean.- 
- Parameters:
- val- Object to be coerced.
- Returns:
- The Boolean coerced value, or null if none possible.
 
coerceInteger
public static Integer coerceInteger(Object val)
                             throws Exception
- Coerce to a Integer.- 
- Parameters:
- val- Object to be coerced.
- Returns:
- The Integer coerced value.
- Throws:
- Exception- If Integer coercion fails.
 
coerceLong
public static Long coerceLong(Object val)
                       throws Exception
- Coerce to a Long.- 
- Parameters:
- val- Object to be coerced.
- Returns:
- The Long coerced value.
- Throws:
- Exception- If Long coercion fails.
 
coerceDouble
public static Double coerceDouble(Object val)
                           throws Exception
- Coerce to a Double.- 
- Parameters:
- val- Object to be coerced.
- Returns:
- The Double coerced value.
- Throws:
- Exception- If Double coercion fails.
 
isFloatingPoint
public static boolean isFloatingPoint(Object o)
- Is Object a floating point number.- 
- Parameters:
- o- Object to be analyzed.
- Returns:
- true if it is a Float or a Double.
 
isNumberable
public static boolean isNumberable(Object o)
- Is Object a whole number.- 
- Parameters:
- o- Object to be analyzed.
- Returns:
- true if Integer, Long, Byte, Short or Character.
 
Copyright © 2003-2006 The Apache Software Foundation. All Rights Reserved.