public static Class<?> getSupportedCollectionEntryType(DozerPropertyDescriptor pd) { Class<?> entryType = pd.genericType(); if (entryType == null) { entryType = getSupportedCollectionEntryType(pd.getPropertyType()); } return entryType; }
public void setPropertyValue(Object bean, Object value, FieldMap fieldMap) { Object intermediateResult = bean; for (int i = 0; i < descriptorChain.length; i++) { DozerPropertyDescriptor descriptor = descriptorChain[i]; if (i != descriptorChain.length - 1) { Object currentValue = descriptor.getPropertyValue(intermediateResult); if (currentValue == null) { currentValue = DestBeanCreator.create(descriptor.getPropertyType()); descriptor.setPropertyValue(intermediateResult, currentValue, fieldMap); } intermediateResult = currentValue; } else { // last one descriptor.setPropertyValue(intermediateResult, value, fieldMap); } } }
public Class<?> getPropertyType() { return descriptorChain[descriptorChain.length - 1].getPropertyType(); }
public Object getPropertyValue(Object bean) { Object intermediateResult = bean; for (DozerPropertyDescriptor descriptor : descriptorChain) { intermediateResult = descriptor.getPropertyValue(intermediateResult); if (intermediateResult == null) { return null; } } return intermediateResult; }
public void writeDestValue(Object runtimeDestObj, Object destFieldValue) { if (log.isDebugEnabled()) { String className = MappingUtils.getClassNameWithoutPackage(runtimeDestObj.getClass()); log.debug("Getting ready to invoke write method on the destination object. Dest Obj: {}, Dest value: {}", className, destFieldValue); } DozerPropertyDescriptor propDescriptor = getDestPropertyDescriptor(runtimeDestObj.getClass()); propDescriptor.setPropertyValue(runtimeDestObj, destFieldValue, this); }
public Class<?> genericType() { return descriptorChain[descriptorChain.length - 1].genericType(); }
public Class<?> getPropertyType() { return descriptorChain[descriptorChain.length - 1].getPropertyType(); }
public Object getPropertyValue(Object bean) { Object intermediateResult = bean; for (DozerPropertyDescriptor descriptor : descriptorChain) { intermediateResult = descriptor.getPropertyValue(intermediateResult); if (intermediateResult == null) { return null; } } return intermediateResult; }
public void writeDestValue(Object runtimeDestObj, Object destFieldValue) { if (log.isDebugEnabled()) { String className = MappingUtils.getClassNameWithoutPackage(runtimeDestObj.getClass()); log.debug("Getting ready to invoke write method on the destination object. Dest Obj: {}, Dest value: {}", className, destFieldValue); } DozerPropertyDescriptor propDescriptor = getDestPropertyDescriptor(runtimeDestObj.getClass()); propDescriptor.setPropertyValue(runtimeDestObj, destFieldValue, this); }
public Class<?> genericType() { return descriptorChain[descriptorChain.length - 1].genericType(); }
public void setPropertyValue(Object bean, Object value, FieldMap fieldMap) { Object intermediateResult = bean; for (int i = 0; i < descriptorChain.length; i++) { DozerPropertyDescriptor descriptor = descriptorChain[i]; if (i != descriptorChain.length - 1) { Object currentValue = descriptor.getPropertyValue(intermediateResult); if (currentValue == null) { currentValue = DestBeanCreator.create(null, descriptor.getPropertyType()); descriptor.setPropertyValue(intermediateResult, currentValue, fieldMap); } intermediateResult = currentValue; } else { // last one descriptor.setPropertyValue(intermediateResult, value, fieldMap); } } }
public Class<?> getPropertyType() { return descriptorChain[descriptorChain.length - 1].getPropertyType(); }
public Object getPropertyValue(Object bean) { Object[] values = new Object[propertyDescriptors.length]; for (int i = 0; i < propertyDescriptors.length; i++) { values[i] = propertyDescriptors[i].getPropertyValue(bean); } return values; }
public static Class<?> getSupportedCollectionEntryType(DozerPropertyDescriptor pd) { Class<?> entryType = pd.genericType(); if (entryType == null) { entryType = getSupportedCollectionEntryType(pd.getPropertyType()); } return entryType; }
public void writeDestValue(Object runtimeDestObj, Object destFieldValue) { if (log.isDebugEnabled()) { String className = MappingUtils.getClassNameWithoutPackage(runtimeDestObj.getClass()); log.debug("Getting ready to invoke write method on the destination object. Dest Obj: {}, Dest value: {}", className, destFieldValue); } DozerPropertyDescriptor propDescriptor = getDestPropertyDescriptor(BuilderUtil.unwrapDestClassFromBuilder(runtimeDestObj)); propDescriptor.setPropertyValue(runtimeDestObj, destFieldValue, this); }
public Class<?> genericType() { return descriptorChain[descriptorChain.length - 1].genericType(); }
public void setPropertyValue(Object bean, Object value, FieldMap fieldMap) { Object intermediateResult = bean; for (int i = 0; i < descriptorChain.length; i++) { DozerPropertyDescriptor descriptor = descriptorChain[i]; if (i != descriptorChain.length - 1) { Object currentValue = descriptor.getPropertyValue(intermediateResult); if (currentValue == null) { currentValue = DestBeanCreator.create(null, descriptor.getPropertyType()); descriptor.setPropertyValue(intermediateResult, currentValue, fieldMap); } intermediateResult = currentValue; } else { // last one descriptor.setPropertyValue(intermediateResult, value, fieldMap); } } }
public static Class<?> getDeepFieldType(Class<?> clazz, String fieldName, HintContainer deepIndexHintContainer) { // follow deep field hierarchy. If any values are null along the way, then return null DozerPropertyDescriptor[] hierarchy = getDeepFieldHierarchy(clazz, fieldName, deepIndexHintContainer); return hierarchy[hierarchy.length - 1].getPropertyType(); }
public Object getPropertyValue(Object bean) { Object[] values = new Object[propertyDescriptors.length]; for (int i = 0; i < propertyDescriptors.length; i++) { values[i] = propertyDescriptors[i].getPropertyValue(bean); } return values; }
latestClass = propDescriptor.getPropertyType(); if (toks.hasMoreTokens()) { if (latestClass.isArray()) { latestClass = latestClass.getComponentType(); } else if (Collection.class.isAssignableFrom(latestClass)) { Class<?> genericType = propDescriptor.genericType();