public Object convert(Object value, ConvertChain chain) {
Class targetType = chain.getTargetType();
Class componentType = targetType.getComponentType();
if (componentType == null) {
throw new ConvertFailedException();
}
if (value == null) {
throw new ConvertFailedException().setDefaultValue(Array.newInstance(componentType, 0));
}
if (targetType.isInstance(value)) {
return value;
}