PropertyUtils.setNestedProperty(bean, currentFieldName, defaultInstance); PropertyUtils.setNestedProperty(bean, propertyName, value); } catch (Exception e) { throw new MetaException(
quantityBasedRule.setMatchRule(dw.getRawMvel()); PropertyUtils.setNestedProperty(quantityBasedRule, mappedBy, parent); } catch (Exception e) { throw new RuntimeException(e);
public static void setNestedProperty(Object bean, String name, Object value){ try { org.apache.commons.beanutils.PropertyUtils.setNestedProperty(bean, name, value); }catch(Exception e) { handleException(e); } }
/** * @param object * @param fieldName * @param path */ public static void setNestedProperty(Object object, String fieldName, Object value) { try { PropertyUtils.setNestedProperty(object, fieldName, value); } catch(Exception ex) { String className = (object == null) ? "<null>" : object.getClass().getName(); throw new JcrMappingException("Cannot set the field " + fieldName + " in the class : " + className, ex); } }
/** * @param object * @param fieldName * @param path */ public static void setNestedProperty(Object object, String fieldName, Object value) { try { PropertyUtils.setNestedProperty(object, fieldName, value); } catch(Exception ex) { String className = (object == null) ? "<null>" : object.getClass().getName(); throw new JcrMappingException("Cannot set the field " + fieldName + " in the class : " + className, ex); } }
@Override void execute(Function<Object, IObject> mapping) throws GraphException { final Object duplicateValue = GraphUtil.copyComplexValue(mapping, value); if (duplicateValue != null) { try { PropertyUtils.setNestedProperty(duplicate, property, duplicateValue); } catch (NestedNullException | ReflectiveOperationException e) { throw new GraphException( "cannot set property " + property + " on duplicate " + duplicate.getClass().getName()); } } } }
@Override protected Object invokeWriteMethod(PropertyDescriptor pd, Object beanInstance, Object value) throws Exception { String rname = (String) pd.getValue("relation.name"); if( rname!=null ) { String nestedProperty = String.format( "%s.%s", rname,pd.getName() ); Log.debug( "====> SET JOIN PROPERTY [{0}]=[{1}]", nestedProperty, value.getClass().getName()); PropertyUtils.setNestedProperty(beanInstance, nestedProperty, value); return null; } String rattr = (String) pd.getValue("relation.attribute"); if( rattr!=null ) { String nestedProperty = String.format( "%s.%s", pd.getName(), rattr ); Log.debug( "====> SET JOIN PROPERTY {0}]=[{1}]", nestedProperty, value ); PropertyUtils.setNestedProperty(beanInstance, nestedProperty, value); return null; } return super.invokeWriteMethod(pd, beanInstance, value); }
PropertyUtils.setNestedProperty(bo, propertyName, propertyValue);
PropertyUtils.setNestedProperty(mobileBean, nestedProperty, ConvertUtils.convert(value, metaData.getPropertyType().getComponentType())); PropertyUtils.setNestedProperty(mobileBean, nestedProperty, ConvertUtils.convert(value, metaData.getPropertyType())); PropertyUtils.setNestedProperty(mobileBean, nestedProperty, ConvertUtils.convert(value, metaData.getPropertyType()));
if (((HashMap) parentPropertyValue).keySet().contains(propertyName.substring(propertyName.lastIndexOf('.') + 1))) { ((HashMap) parentPropertyValue).remove(propertyName.substring(propertyName.lastIndexOf('.') + 1)); PropertyUtils.setNestedProperty(target, parentPropertyName, parentPropertyValue); return true; } else {
if (((HashMap) parentPropertyValue).keySet().contains(propertyName.substring(propertyName.lastIndexOf('.') + 1))) { ((HashMap) parentPropertyValue).remove(propertyName.substring(propertyName.lastIndexOf('.') + 1)); PropertyUtils.setNestedProperty(target, parentPropertyName, parentPropertyValue); return true; } else {
PropertyUtils.setNestedProperty(bean, beanName, newbean); innerBeans.put(beanName, newbean); PropertyUtils.setNestedProperty(bean, key, valueObject); i = i + 2;
PropertyUtils.setNestedProperty(bo, propertyName, propertyValue);