{
convertedInput = convertValue(getInputAsArray());
}
catch (ConversionException e)
{
ValidationError error = new ValidationError();
if (e.getResourceKey() != null)
{
error.addKey(e.getResourceKey());
}
if (e.getTargetType() != null)
{
error.addKey("ConversionError." + Classes.simpleName(e.getTargetType()));
}
error.addKey("ConversionError");
reportValidationError(e, error);
}
}
else
{
final IConverter<T> converter = getConverter(getType());
try
{
convertedInput = converter.convertToObject(getInput(), getLocale());
}
catch (ConversionException e)
{
ValidationError error = new ValidationError();
if (e.getResourceKey() != null)
{
error.addKey(e.getResourceKey());
}
String simpleName = Classes.simpleName(getType());
error.addKey("IConverter." + simpleName);
error.addKey("IConverter");
error.setVariable("type", simpleName);
reportValidationError(e, error);
}
}
}