public class IConverterWrapper extends Object implements IConverter
Constructor and Description |
---|
IConverterWrapper(org.apache.commons.beanutils.Converter c,
Class<?>... types) |
Modifier and Type | Method and Description |
---|---|
Object |
convertArrayToString(Object o)
Handles conversions of Arrays of Objects to Arrays of String.
|
Object |
convertArrayToType(Class<?> type,
Object o)
Requests conversion to Arrays of one of the types handled by the
IConverter . |
Collection<?> |
convertCollectionToString(Object o)
Handles conversions of Collections of Objects to Collections of String.
|
Collection<?> |
convertCollectionToType(Class<?> type,
Object o)
Requests conversion to Collections of one of the types handled by the
IConverter . |
String |
convertToString(Object o)
Requests conversion to a String for the provided Object.
|
<T> T |
convertToType(Class<T> type,
Object o)
Requests conversion to a one of the types handled by the
IConverter . |
Class<?>[] |
getTypes()
Returns types handled by the converter.
|
org.apache.commons.beanutils.Converter |
getWrappedConverter() |
Object |
stringConversion(Object o)
Requests to choose between
IConverter.convertToString(Object) , IConverter.convertArrayToString(Object) depending on
provided Object type. |
Object |
typeConversion(Class<?> type,
Object o)
Requests to choose between
IConverter.convertToType(Class, Object) , IConverter.convertArrayToType(Class, Object) depending on
provided Object type. |
public IConverterWrapper(org.apache.commons.beanutils.Converter c, Class<?>... types)
public org.apache.commons.beanutils.Converter getWrappedConverter()
public Object stringConversion(Object o) throws ConvertException
IConverter
IConverter.convertToString(Object)
, IConverter.convertArrayToString(Object)
depending on
provided Object type.stringConversion
in interface IConverter
ConvertException
public String convertToString(Object o) throws ConvertException
IConverter
IConverter
, otherwise the default Object.toString()
is invoked.IConverter.stringConversion(Object)
in these cases.convertToString
in interface IConverter
ConvertException
public Object convertArrayToString(Object o) throws ConvertException
IConverter
convertArrayToString
in interface IConverter
ConvertException
public Collection<?> convertCollectionToString(Object o)
IConverter
convertCollectionToString
in interface IConverter
public Object typeConversion(Class<?> type, Object o) throws ConvertException
IConverter
IConverter.convertToType(Class, Object)
, IConverter.convertArrayToType(Class, Object)
depending on
provided Object type.typeConversion
in interface IConverter
ConvertException
public <T> T convertToType(Class<T> type, Object o) throws ConvertException
IConverter
IConverter
. If the type is not handled, an Exception
will be raised.String
.class, and redirect to IConverter.stringConversion(Object)
.IConverter.typeConversion(Class, Object)
in these cases.convertToType
in interface IConverter
ConvertException
public Object convertArrayToType(Class<?> type, Object o) throws ConvertException
IConverter
IConverter
. If the type is not handled, an Exception
will be raised.String
.class, and redirect to IConverter.stringConversion(Object)
.convertArrayToType
in interface IConverter
ConvertException
public Collection<?> convertCollectionToType(Class<?> type, Object o) throws ConvertException
IConverter
IConverter
. If the type is not handled, an Exception
will be raised.String
.class, and redirect to IConverter.stringConversion(Object)
.convertCollectionToType
in interface IConverter
ConvertException
public Class<?>[] getTypes()
IConverter
getTypes
in interface IConverter