public class TypeConverter extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
convert(Class<?> type,
String s)
将 String 数据转换为指定的类型
|
Map<Class<?>,IConverter<?>> |
getConverterMap() |
Func.F21<Class<?>,String,Object> |
getConvertFunc() |
static TypeConverter |
me() |
<T> void |
regist(Class<T> type,
IConverter<T> converter) |
void |
setConvertFunc(Func.F21<Class<?>,String,Object> convertFunc) |
public static TypeConverter me()
public <T> void regist(Class<T> type, IConverter<T> converter)
public Map<Class<?>,IConverter<?>> getConverterMap()
public final Object convert(Class<?> type, String s) throws ParseException
type - 需要转换成为的数据类型s - 被转换的 String 类型数据ParseExceptionCopyright © 2022. All rights reserved.