A utility class that tries to convert an Object of one arbitrary type to
an Objects of another arbitrary type. The default configuration of a
ConvertUtils can be extended by registering additional Converter
s.
A ConvertUtils
instance is required by CopyUtils
to copy one object to another.
The Converter
interface defines the following method
that does the work of converting an Object from one type to another:
public Object convert(Object value, Class fromType, Class toType, Locale locale);
A Converter
can be registered with a ConvertUtils
instance
to handle the conversion between particular types.
The Converters
class contains a number of Converter
classes that convert between some of the simple Java types. These Converter
s
are used to configure default instances of ConvertUtils.