public class TypeConverterManagerBean
extends java.lang.Object
TypeConverterManager.| Modifier and Type | Field and Description |
|---|---|
protected ConvertBean |
convertBean |
| Constructor and Description |
|---|
TypeConverterManagerBean() |
| Modifier and Type | Method and Description |
|---|---|
<T> java.util.Collection<T> |
convertToCollection(java.lang.Object value,
java.lang.Class<? extends java.util.Collection> destinationType,
java.lang.Class componentType)
Special case of
convertType(Object, Class) when target is collection and
when component type is known. |
<T> T |
convertType(java.lang.Object value,
java.lang.Class<T> destinationType)
Converts an object to destination type.
|
ConvertBean |
getConvertBean()
Returns
ConvertBean. |
TypeConverter |
lookup(java.lang.Class type)
Retrieves converter for provided type.
|
void |
register(java.lang.Class type,
TypeConverter typeConverter)
Registers a converter for specified type.
|
void |
registerDefaults()
Registers default set of converters.
|
void |
unregister(java.lang.Class type)
Un-registers converter for given type.
|
protected ConvertBean convertBean
public ConvertBean getConvertBean()
ConvertBean.public void registerDefaults()
public void register(java.lang.Class type,
TypeConverter typeConverter)
type - class that converter is fortypeConverter - converter for provided classpublic void unregister(java.lang.Class type)
public TypeConverter lookup(java.lang.Class type)
nullpublic <T> T convertType(java.lang.Object value,
java.lang.Class<T> destinationType)
TypeConverter will be used. If not, it scans of destination is
an array or enum, as those two cases are handled in a special way.
If destination type is one of common types, consider using Convert
instead for somewhat faster approach (no lookup).
public <T> java.util.Collection<T> convertToCollection(java.lang.Object value,
java.lang.Class<? extends java.util.Collection> destinationType,
java.lang.Class componentType)
convertType(Object, Class) when target is collection and
when component type is known.Copyright © 2003-2013 Jodd Team