protected UserIndicateurs inc(UserIndicateurs userIndicateurs, String methodName, int inc) { try { String value = BeanUtils.getSimpleProperty(userIndicateurs, methodName); int i = Integer.parseInt(value); i = i + inc; BeanUtils.setProperty(userIndicateurs, methodName, i); } catch (Exception eee) { log.error("Failled to inc : " + methodName, eee); } return userIndicateurs; } }
@Override public String serialize(Object o, Field field) throws SerializerException { try { return BeanUtils.getSimpleProperty(o, field.getName()); } catch (final Exception e) { throw new SerializerException(e); } } }
public static String getSimpleProperty(Object bean, String name) { try { return org.apache.commons.beanutils.BeanUtils.getSimpleProperty(bean, name); } catch (Exception e) { handleReflectionException(e); return null; } }
@Override public <E extends TopiaEntity> E copyEntityIfNecessary(TopiaContext transaction, E beanFrom, E beanTo, String field) { try { String fromValue = BeanUtils.getSimpleProperty(beanFrom, field); String toValue = BeanUtils.getSimpleProperty(beanTo, field); if (fromValue == null || !fromValue.equals(toValue)) { BeanUtils.setProperty(beanTo, field, fromValue); incNbMaj(transaction); } } catch (Exception eee) { log.error("Failed to copy property " + field + " on bean " + beanFrom, eee); } return beanTo; }
@Override public <E extends TopiaEntity> E copyEntityIfNecessary(TopiaContext transaction, E beanFrom, E beanTo, String field) { try { String fromValue = BeanUtils.getSimpleProperty(beanFrom, field); String toValue = BeanUtils.getSimpleProperty(beanTo, field); if (fromValue == null || !fromValue.equals(toValue)) { BeanUtils.setProperty(beanTo, field, fromValue); incNbMaj(transaction); } } catch (Exception eee) { log.error("Failed to copy property " + field + " on bean " + beanFrom, eee); } return beanTo; }
/** * convert object to YAML */ public static String toYAML(Object object) throws PragmatachException { try { final Map<String, String> map = new HashMap<String, String>(); for (final Field field : object.getClass().getDeclaredFields()) { map.put(field.getName(), BeanUtils.getSimpleProperty(object, field.getName())); } final Yaml yaml = new Yaml(); return yaml.dump(map); } catch (final Exception e) { throw new PragmatachException("Exception in toYAML", e); } }
protected UserIndicateurs inc(UserIndicateurs userIndicateurs, String methodName, int inc) { try { if (userIndicateurs != null) { String value = BeanUtils.getSimpleProperty(userIndicateurs, methodName); int i = Integer.parseInt(value); i = i + inc; BeanUtils.setProperty(userIndicateurs, methodName, i); } else { log.warn("Failled to inc : " + methodName + " because userIndicateurs is null"); } } catch (Exception eee) { log.error("Failled to inc : " + methodName, eee); } return userIndicateurs; } }
batchValue = BeanUtils.getSimpleProperty(batchCustomer, propertyName); existingValue = BeanUtils.getSimpleProperty(existingCustomer, propertyName);
String objProperty = BeanUtils.getSimpleProperty(argument, rule.getProperty()); switch (rule.getModifier())