org.apache.commons.beanutils
public class ConvertUtils extends Object
Utility methods for converting String scalar values to objects of the specified Class, String arrays to arrays of the specified Class.
For more details, see ConvertUtilsBean
which provides the
implementations for these methods.
Version: $Revision: 1.17 $ $Date: 2004/02/28 13:18:33 $
See Also: ConvertUtilsBean
Method Summary | |
---|---|
static String | convert(Object value) Convert the specified value into a String. For more details see |
static Object | convert(String value, Class clazz) Convert the specified value to an object of the specified class (if possible). |
static Object | convert(String[] values, Class clazz) Convert an array of specified values to an array of objects of the specified class (if possible). For more details see |
static void | deregister() Remove all registered Converters, and re-establish the standard Converters. For more details see |
static void | deregister(Class clazz) Remove any registered Converter for the specified destination
For more details see |
static boolean | getDefaultBoolean()
Gets the default value for Boolean conversions. |
static byte | getDefaultByte()
Gets the default value for Byte conversions. |
static char | getDefaultCharacter()
Gets the default value for Character conversions. |
static double | getDefaultDouble()
Gets the default value for Double conversions. |
static float | getDefaultFloat()
Get the default value for Float conversions. |
static int | getDefaultInteger()
Gets the default value for Integer conversions. |
static long | getDefaultLong()
Gets the default value for Long conversions. |
static short | getDefaultShort()
Gets the default value for Short conversions. |
static Converter | lookup(Class clazz) Look up and return any registered Converter for the specified
destination class; if there is no registered Converter, return
For more details see |
static void | register(Converter converter, Class clazz) Register a custom Converter for the specified destination
For more details see |
static void | setDefaultBoolean(boolean newDefaultBoolean)
Sets the default value for Boolean conversions. |
static void | setDefaultByte(byte newDefaultByte)
Sets the default value for Byte conversions. |
static void | setDefaultCharacter(char newDefaultCharacter)
Sets the default value for Character conversions. |
static void | setDefaultDouble(double newDefaultDouble)
Sets the default value for Double conversions. |
static void | setDefaultFloat(float newDefaultFloat)
Sets the default value for Float conversions. |
static void | setDefaultInteger(int newDefaultInteger)
Sets the default value for Integer conversions. |
static void | setDefaultLong(long newDefaultLong)
Sets the default value for Long conversions. |
static void | setDefaultShort(short newDefaultShort)
Sets the default value for Short conversions. |
Convert the specified value to an object of the specified class (if possible). Otherwise, return a String representation of the value.
For more details see ConvertUtilsBean
.
See Also: ConvertUtilsBean
Convert an array of specified values to an array of objects of the specified class (if possible).
For more details see ConvertUtilsBean
.
See Also: (String[], Class)
Remove all registered Converters, and re-establish the standard Converters.
For more details see ConvertUtilsBean
.
See Also: deregister
Remove any registered Converter for the specified destination
Class
.
For more details see ConvertUtilsBean
.
See Also: deregister
Deprecated: Register replacement converters for Boolean.TYPE and Boolean.class instead
Gets the default value for Boolean conversions.Deprecated: Register replacement converters for Byte.TYPE and Byte.class instead
Gets the default value for Byte conversions.Deprecated: Register replacement converters for Character.TYPE and Character.class instead
Gets the default value for Character conversions.Deprecated: Register replacement converters for Double.TYPE and Double.class instead
Gets the default value for Double conversions.Deprecated: Register replacement converters for Float.TYPE and Float.class instead
Get the default value for Float conversions.Deprecated: Register replacement converters for Integer.TYPE and Integer.class instead
Gets the default value for Integer conversions.Deprecated: Register replacement converters for Long.TYPE and Long.class instead
Gets the default value for Long conversions.Deprecated: Register replacement converters for Short.TYPE and Short.class instead
Gets the default value for Short conversions.Look up and return any registered Converter for the specified
destination class; if there is no registered Converter, return
null
.
For more details see ConvertUtilsBean
.
See Also: lookup
Register a custom Converter for the specified destination
Class
, replacing any previously registered Converter.
For more details see ConvertUtilsBean
.
See Also: ConvertUtilsBean
Deprecated: Register replacement converters for Boolean.TYPE and Boolean.class instead
Sets the default value for Boolean conversions.Deprecated: Register replacement converters for Byte.TYPE and Byte.class instead
Sets the default value for Byte conversions.Deprecated: Register replacement converters for Character.TYPE and Character.class instead
Sets the default value for Character conversions.Deprecated: Register replacement converters for Double.TYPE and Double.class instead
Sets the default value for Double conversions.Deprecated: Register replacement converters for Float.TYPE and Float.class instead
Sets the default value for Float conversions.Deprecated: Register replacement converters for Integer.TYPE and Integer.class instead
Sets the default value for Integer conversions.Deprecated: Register replacement converters for Long.TYPE and Long.class instead
Sets the default value for Long conversions.Deprecated: Register replacement converters for Short.TYPE and Short.class instead
Sets the default value for Short conversions.