|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jec.ObjectConverter
ObjectsConverter instances provide methods for common object to object conversions and object to basic type conversions. It handles special conversions as currencies, dates, and percents.
Constructor Summary | |
ObjectConverter()
|
Method Summary | |
static java.lang.Object |
convert(java.lang.Object value,
java.lang.Class targetClass)
|
static java.lang.Object |
normalize(java.lang.Object number)
Normalizes a Number: its minimum values equal 'null' objects. |
static boolean |
toBoolean(java.lang.Object obj)
Converts an object into a boolean basic type. |
static double |
toDouble(java.lang.Number obj)
Converts a number into a double basic type |
static double |
toDouble(java.lang.Object obj)
Converts an Object into a double basic type |
static int |
toInt(java.lang.Number obj)
Converts a number into an int basic type |
static int |
toInt(java.lang.Object obj)
Converts an Object into an int basic type |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ObjectConverter()
Method Detail |
public static java.lang.Object convert(java.lang.Object value, java.lang.Class targetClass) throws ConversionException
ConversionException
public static int toInt(java.lang.Number obj) throws ConversionException
obj
- The Number to convert
ConversionException
public static int toInt(java.lang.Object obj) throws ConversionException
obj
- The Object to convert
ConversionException
public static double toDouble(java.lang.Number obj) throws ConversionException
obj
- The Number to convert
ConversionException
public static double toDouble(java.lang.Object obj) throws ConversionException
obj
- The Object to convert
ConversionException
public static java.lang.Object normalize(java.lang.Object number)
number
- The Number to normalize
public static boolean toBoolean(java.lang.Object obj) throws ConversionException
java.lang.Boolean
are converted into its values. Objects
which toString() method equals (ignoring case) "true" or "false" are also
succesfully converted. Other objects are rejected and a
ConversionException is thrown.
ConversionException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |