{
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." + e.getTargetType().getSimpleName());
}
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 = getType().getSimpleName();
error.addKey("IConverter." + simpleName);
error.addKey("IConverter");
error.setVariable("type", simpleName);
reportValidationError(e, error);
}
}
}