| java.lang.Object org.apache.jorphan.util.Converter
Converter | public class Converter (Code) | | author: Michael Stover |
Method Summary | |
public static Object | convert(Object value, Class toType) | public static String | formatCalendar(Calendar date, String pattern) | public static String | formatDate(Date date, String pattern) | public static String | formatDate(java.sql.Date date, String pattern) | public static String | formatDate(String date, String pattern) | public static String | formatDate(Calendar date, String pattern) | public String | formatNumber(float num, String pattern) | public static boolean | getBoolean(Object o) | public static boolean | getBoolean(Object o, boolean defaultValue) | public static Calendar | getCalendar(Object date, Calendar defaultValue) Converts the given object to a calendar object. | public static Calendar | getCalendar(Object o) | public static char | getChar(Object o) | public static char | getChar(Object o, char defaultValue) | public static Date | getDate(Object date) | public static Date | getDate(Object date, Date defaultValue) | public static double | getDouble(Object o, double defaultValue) | public static double | getDouble(Object o) | public static float | getFloat(Object o, float defaultValue) | public static float | getFloat(Object o) | public static int | getInt(Object o, int defaultValue) Convert object to integer, return defaultValue if object is not
convertible or is null. | public static int | getInt(Object o) Converts object to an integer, defaults to 0 if object is not convertible
or is null. | public static long | getLong(Object o, long defaultValue) Converts object to a long, return defaultValue if object is not
convertible or is null. | public static long | getLong(Object o) | public static String | getString(Object o, String defaultValue) Converts object to a String, return defaultValue if object is null. | public static String | getString(Object o) Converts object to a String, defaults to empty string if object is null. | public static String | insertLineBreaks(String v, String insertion) | public static String | urlEncode(Object toEncode) |
convert | public static Object convert(Object value, Class toType)(Code) | | Convert the given value object to an object of the given type
Parameters: value - Parameters: toType - Object |
getBoolean | public static boolean getBoolean(Object o, boolean defaultValue)(Code) | | |
getCalendar | public static Calendar getCalendar(Object date, Calendar defaultValue)(Code) | | Converts the given object to a calendar object. Defaults to the current
date if the given object can't be converted.
Parameters: date - Calendar |
getChar | public static char getChar(Object o, char defaultValue)(Code) | | |
getDouble | public static double getDouble(Object o, double defaultValue)(Code) | | |
getFloat | public static float getFloat(Object o, float defaultValue)(Code) | | |
getInt | public static int getInt(Object o, int defaultValue)(Code) | | Convert object to integer, return defaultValue if object is not
convertible or is null.
Parameters: o - Parameters: defaultValue - int |
getInt | public static int getInt(Object o)(Code) | | Converts object to an integer, defaults to 0 if object is not convertible
or is null.
Parameters: o - int |
getLong | public static long getLong(Object o, long defaultValue)(Code) | | Converts object to a long, return defaultValue if object is not
convertible or is null.
Parameters: o - Parameters: defaultValue - long |
getLong | public static long getLong(Object o)(Code) | | Converts object to a long, defaults to 0 if object is not convertible or
is null
Parameters: o - long |
getString | public static String getString(Object o, String defaultValue)(Code) | | Converts object to a String, return defaultValue if object is null.
Parameters: o - Parameters: defaultValue - String |
getString | public static String getString(Object o)(Code) | | Converts object to a String, defaults to empty string if object is null.
Parameters: o - String |
|
|