{
setMethod.invoke(object, converted);
}
catch (InvocationTargetException ex)
{
throw new WicketRuntimeException("Error calling method: " + setMethod +
" on object: " + object, ex.getCause());
}
catch (Exception ex)
{
throw new WicketRuntimeException("Error calling method: " + setMethod +
" on object: " + object, ex);
}
}
else if (field != null)
{
try
{
field.set(object, converted);
}
catch (Exception ex)
{
throw new WicketRuntimeException("Error setting field: " + field +
" on object: " + object, ex);
}
}
else
{
throw new WicketRuntimeException("no set method defined for value: " + value +
" on object: " + object + " while respective getMethod being " +
getMethod.getName());
}
}