{
PropertyUtils.setProperty(bean, name, value);
}
catch(NoSuchMethodException ex)
{
throw new ModelException(ex);
}
catch(java.lang.IllegalArgumentException ex)
{ // Check if this is an enumeration
try {
setEnumProperty(bean, name, value.toString());
}
catch(ModelException ex2 )
{ // Throw surrounding exception
//System.out.println("Fail to set '"+ bean.getClass().getName() +"." +name + "'='"+value+"' as enum:" + ex2);
//ex2.printStackTrace();
throw new ModelException(ex);
}
catch(InvalidNameException ex2 )
{ // Throw this exception
//System.out.println("Fail to set '"+ bean.getClass().getName() +"." +name + "'='"+value+"' as enum:" + ex2);
//ex2.printStackTrace();
//throw new Error(ex2);
throw new ModelException(ex2);
}
}
catch(InvocationTargetException ex)
{
throw new ModelException(ex);
}
catch(IllegalAccessException ex)
{
throw new ModelException(ex);
}
}