public class BeanConverter extends Object implements Converter, Serializable
Map =》 Bean Bean =》 Bean ValueProvider =》 Bean
| Modifier and Type | Field and Description |
|---|---|
static BeanConverter |
INSTANCE
单例对象
|
| Constructor and Description |
|---|
BeanConverter()
构造
|
BeanConverter(CopyOptions copyOptions)
构造
|
| Modifier and Type | Method and Description |
|---|---|
Object |
convert(Type targetType,
Object value)
转换为指定类型
如果类型无法确定,将读取默认值的类型做为目标类型 |
public static BeanConverter INSTANCE
public BeanConverter()
public BeanConverter(CopyOptions copyOptions)
copyOptions - Bean转换选项参数public Object convert(Type targetType, Object value) throws ConvertException
Converterconvert in interface ConvertertargetType - 目标Type,非泛型类使用value - 原始值,如果对象实现了此接口,则value为thisConvertException - 转换无法正常完成或转换异常时抛出此异常Copyright © 2025. All rights reserved.