public class ArrayConverter extends AbstractConverter<Object>
Constructor and Description |
---|
ArrayConverter(Class<?> targetType)
构造
|
ArrayConverter(Class<?> targetType,
boolean ignoreElementError)
构造
|
Modifier and Type | Method and Description |
---|---|
protected Object |
convertInternal(Object value)
内部转换器,被
AbstractConverter.convert(Object, Object) 调用,实现基本转换逻辑内部转换器转换后如果转换失败可以做如下操作,处理结果都为返回默认值: 1、返回 null
2、抛出一个RuntimeException 异常
|
Class |
getTargetType()
获得此类实现类的泛型类型
|
void |
setIgnoreElementError(boolean ignoreElementError)
设置是否忽略元素转换错误
|
convert, convertQuietly, convertToStr
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertWithCheck
public ArrayConverter(Class<?> targetType)
targetType
- 目标数组类型public ArrayConverter(Class<?> targetType, boolean ignoreElementError)
targetType
- 目标数组类型ignoreElementError
- 是否忽略元素转换错误protected Object convertInternal(Object value)
AbstractConverter
AbstractConverter.convert(Object, Object)
调用,实现基本转换逻辑1、返回null
2、抛出一个RuntimeException
异常
convertInternal
in class AbstractConverter<Object>
value
- 值public Class getTargetType()
AbstractConverter
getTargetType
in class AbstractConverter<Object>
null
public void setIgnoreElementError(boolean ignoreElementError)
ignoreElementError
- 是否忽略元素转换错误Copyright © 2024. All rights reserved.