public class ConverterManager extends Object
| Constructor and Description |
|---|
ConverterManager() |
ConverterManager(StringSplitter stringSplitter)
Creates an instance manager with given string splitter.
|
| Modifier and Type | Method and Description |
|---|---|
protected <T> void |
addConverter(Class<T> type,
Converter<T> converter)
Add converter to the storage.
|
protected <T> Collection<T> |
castCollectionToType(Class collectionType,
Collection<T> converted)
Create an instance of specified collection with given element type.
|
Object |
convert(Class<?> type,
String origin)
Convert given string to type.
|
<T> Object |
convert(Class collectionType,
Class<T> elementType,
String origin)
Convert given string to specified collection with given element type.
|
protected Object |
convertNullValue(Class type)
Convert null to given type.
|
protected <T> Converter<T> |
find(Class<T> type)
Find converter for given type.
|
<T> void |
register(Class<T> type,
Converter<T> converter)
Register converter.
|
protected void |
registerDefaults()
Register converters supported by default.
|
public static final String COMMA
public ConverterManager()
public ConverterManager(StringSplitter stringSplitter)
protected void registerDefaults()
protected <T> void addConverter(Class<T> type, Converter<T> converter)
protected <T> Converter<T> find(Class<T> type) throws ConversionException
ConversionExceptionpublic Object convert(Class<?> type, String origin) throws ConversionException
ConversionException - If can't find converter for given type.find(Class)protected Object convertNullValue(Class type) throws ConversionException
ConversionException - if any occurs.public <T> Object convert(Class collectionType, Class<T> elementType, String origin) throws ConversionException
ConversionException - If any occurs.find(Class)protected <T> Collection<T> castCollectionToType(Class collectionType, Collection<T> converted) throws ConversionException
ConversionExceptionCopyright © 2015 QATools. All Rights Reserved.