public Class<?> getPropertyType() { return descriptorChain[descriptorChain.length - 1].getPropertyType(); }
public Class<?> getPropertyType() { return descriptorChain[descriptorChain.length - 1].getPropertyType(); }
public Class<?> getPropertyType() { return descriptorChain[descriptorChain.length - 1].getPropertyType(); }
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(); }
@Override public Class<?> getDestFieldType(Class<?> runtimeDestClass) { return getSrcPropertyDescriptor(runtimeDestClass).getPropertyType(); }
@Override public Class<?> getDestFieldType(Class<?> runtimeDestClass) { return getSrcPropertyDescriptor(runtimeDestClass).getPropertyType(); }
public Class<?> getSrcFieldType(Class<?> runtimeSrcClass) { return getSrcPropertyDescriptor(runtimeSrcClass).getPropertyType(); }
public Class<?> getSrcFieldType(Class<?> runtimeSrcClass) { return getSrcPropertyDescriptor(runtimeSrcClass).getPropertyType(); }
public Class<?> getSrcFieldType(Class<?> runtimeSrcClass) { return getSrcPropertyDescriptor(runtimeSrcClass).getPropertyType(); }
public Class<?> getSrcFieldType(Class<?> runtimeSrcClass) { return getSrcPropertyDescriptor(runtimeSrcClass).getPropertyType(); }
public Class<?> getSrcFieldType(Class<?> runtimeSrcClass) { return getSrcPropertyDescriptor(runtimeSrcClass).getPropertyType(); }
public static Class<?> getSupportedCollectionEntryType(DozerPropertyDescriptor pd) { Class<?> entryType = pd.genericType(); if (entryType == null) { entryType = getSupportedCollectionEntryType(pd.getPropertyType()); } return entryType; }
public static Class<?> getSupportedCollectionEntryType(DozerPropertyDescriptor pd) { Class<?> entryType = pd.genericType(); if (entryType == null) { entryType = getSupportedCollectionEntryType(pd.getPropertyType()); } return entryType; }
public Class<?> getDestFieldType(Class<?> runtimeDestClass) { Class<?> result = null; if (isDestFieldIndexed()) { result = destHintContainer != null ? destHintContainer.getHint() : null; } if (result == null) { result = getDestPropertyDescriptor(runtimeDestClass).getPropertyType(); } return result; }
private Class<?> determineActualPropertyType(String fieldName, boolean isIndexed, int index, Object targetObj, boolean isDestObj) { // Dig out actual Map object by calling getter on top level object DozerPropertyDescriptor pd; if ((isDestObj && isDestFieldAccessible()) || (!isDestObj && isSrcFieldAccessible())) { pd = new FieldPropertyDescriptor(targetObj.getClass(), fieldName, isIndexed, index, getSrcDeepIndexHintContainer(), getDestDeepIndexHintContainer()); } else { pd = new JavaBeanPropertyDescriptor(targetObj.getClass(), fieldName, isIndexed, index, getSrcDeepIndexHintContainer(), getDestDeepIndexHintContainer()); } return pd.getPropertyType(); }
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 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); } } }
private Class<?> determineActualPropertyType(String fieldName, boolean isIndexed, String index, Object targetObj, boolean isDestObj) { // Dig out actual Map object by calling getter on top level object DozerPropertyDescriptor pd; if ((isDestObj && isDestFieldAccessible()) || (!isDestObj && isSrcFieldAccessible())) { pd = new FieldPropertyDescriptor(targetObj.getClass(), fieldName, isIndexed, index, isDestObj ? getDestDeepIndexHintContainer() : getSrcDeepIndexHintContainer()); } else { pd = new JavaBeanPropertyDescriptor(targetObj.getClass(), fieldName, isIndexed, index, isDestObj ? getDestDeepIndexHintContainer() : getSrcDeepIndexHintContainer()); } return pd.getPropertyType(); }
public Class<?> getDestFieldType(Class<?> runtimeDestClass) { Class<?> result = getDestPropertyDescriptor(runtimeDestClass).getPropertyType(); if (isDestFieldIndexed()) { HintContainer hintContainer = destField.getHintContainer(); if (hintContainer != null) { result = hintContainer.getHint(); } else if ((result.isArray() || (Collection.class.isAssignableFrom(result)) && MappingUtils.getSupportedCollectionEntryType(getDestPropertyDescriptor(runtimeDestClass)) != null)) { result = MappingUtils.getSupportedCollectionEntryType(getDestPropertyDescriptor(runtimeDestClass)); } else { result = Object.class; } } return result; }
public Class<?> getDestFieldType(Class<?> runtimeDestClass) { Class<?> result = getDestPropertyDescriptor(runtimeDestClass).getPropertyType(); if (isDestFieldIndexed()) { HintContainer hintContainer = destField.getHintContainer(); if (hintContainer != null) { result = hintContainer.getHint(); } else if ((result.isArray() || (Collection.class.isAssignableFrom(result)) && MappingUtils .getSupportedCollectionEntryType(getDestPropertyDescriptor(runtimeDestClass)) != null)) { result = MappingUtils.getSupportedCollectionEntryType(getDestPropertyDescriptor(runtimeDestClass)); } else { result = Object.class; } } return result; }