public static void setMappedProperty(Object bean, String name, String key,Object value) { try{ org.apache.commons.beanutils.PropertyUtils.setMappedProperty(bean, name, key, value); }catch(Exception e) { handleException(e); } }
public static void setMappedProperty(Object bean, String name, Object value){ try { org.apache.commons.beanutils.PropertyUtils.setMappedProperty(bean, name, value); }catch(Exception e) { handleException(e); } }
/** * Set the value of a mapped property with the specified name. * * @param name Name of the property whose value is to be set * @param key Key of the property to be set * @param value Value to which this property is to be set * * @exception ConversionException if the specified value cannot be * converted to the type required for this property * @exception IllegalArgumentException if there is no property * of the specified name * @exception IllegalArgumentException if the specified property * exists, but is not mapped */ public void set(String name, String key, Object value) { try { PropertyUtils.setMappedProperty(instance, name, key, value); } catch (InvocationTargetException ite) { Throwable cause = ite.getTargetException(); throw new IllegalArgumentException ("Error setting mapped property '" + name + "' nested exception - " + cause); } catch (Throwable t) { throw new IllegalArgumentException ("Error setting mapped property '" + name + "', exception - " + t); } }
/** * Set the value of a mapped property with the specified name. * * @param name Name of the property whose value is to be set * @param key Key of the property to be set * @param value Value to which this property is to be set * * @exception ConversionException if the specified value cannot be * converted to the type required for this property * @exception IllegalArgumentException if there is no property * of the specified name * @exception IllegalArgumentException if the specified property * exists, but is not mapped */ public void set(String name, String key, Object value) { try { PropertyUtils.setMappedProperty(instance, name, key, value); } catch (InvocationTargetException ite) { Throwable cause = ite.getTargetException(); throw new IllegalArgumentException ("Error setting mapped property '" + name + "' nested exception - " + cause); } catch (Throwable t) { throw new IllegalArgumentException ("Error setting mapped property '" + name + "', exception - " + t); } }
/** * Set the value of a mapped property with the specified name. * * @param name Name of the property whose value is to be set * @param key Key of the property to be set * @param value Value to which this property is to be set * * @exception ConversionException if the specified value cannot be * converted to the type required for this property * @exception IllegalArgumentException if there is no property * of the specified name * @exception IllegalArgumentException if the specified property * exists, but is not mapped */ public void set(String name, String key, Object value) { try { PropertyUtils.setMappedProperty(instance, name, key, value); } catch (InvocationTargetException ite) { Throwable cause = ite.getTargetException(); throw new IllegalArgumentException ("Error setting mapped property '" + name + "' nested exception - " + cause); } catch (Throwable t) { throw new IllegalArgumentException ("Error setting mapped property '" + name + "', exception - " + t); } }
Object value = ConvertUtils.convert(propVal, propertyType); PropertyUtils .setMappedProperty(ds, property, subProp, value);