T - Bean类型public class BeanConverter<T> extends AbstractConverter<T>
Map =》 Bean Bean =》 Bean ValueProvider =》 Bean
| Constructor and Description |
|---|
BeanConverter(Class<T> beanClass)
构造,默认转换选项,注入失败的字段忽略
|
BeanConverter(Type beanType)
构造,默认转换选项,注入失败的字段忽略
|
BeanConverter(Type beanType,
CopyOptions copyOptions)
构造
|
| Modifier and Type | Method and Description |
|---|---|
protected T |
convertInternal(Object value)
内部转换器,被
AbstractConverter.convert(Object, Object) 调用,实现基本转换逻辑内部转换器转换后如果转换失败可以做如下操作,处理结果都为返回默认值: 1、返回 null
2、抛出一个RuntimeException异常
|
Class<T> |
getTargetType()
获得此类实现类的泛型类型
|
convert, convertQuietly, convertToStrclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconvertWithCheckpublic BeanConverter(Type beanType)
beanType - 转换成的目标Bean类型public BeanConverter(Class<T> beanClass)
beanClass - 转换成的目标Bean类public BeanConverter(Type beanType, CopyOptions copyOptions)
beanType - 转换成的目标Bean类copyOptions - Bean转换选项参数protected T convertInternal(Object value)
AbstractConverterAbstractConverter.convert(Object, Object) 调用,实现基本转换逻辑1、返回null2、抛出一个RuntimeException异常
convertInternal in class AbstractConverter<T>value - 值public Class<T> getTargetType()
AbstractConvertergetTargetType in class AbstractConverter<T>nullCopyright © 2025. All rights reserved.