public DozerField copyOf() { DozerField copy = new DozerField(name, type); copy.setDateFormat(dateFormat); copy.setTheGetMethod(theGetMethod); copy.setTheSetMethod(theSetMethod); copy.setKey(key); copy.setMapSetMethod(mapSetMethod); copy.setMapGetMethod(mapGetMethod); copy.setAccessible(accessible); copy.setCreateMethod(createMethod); copy.setIndexed(indexed); copy.setIndex(index); return copy; }
public String getSrcFieldCreateMethod() { return srcField.getCreateMethod(); }
public int getSrcFieldIndex() { return srcField.getIndex(); }
public boolean isMapTypeCustomGetterSetterField() { return getMapGetMethod() != null || getMapSetMethod() != null; }
public boolean isCustomGetterSetterField() { return getTheGetMethod() != null || getTheSetMethod() != null; }
public static DozerPropertyDescriptor getPropertyDescriptor(Class<?> clazz, ClassMap classMap, DozerField src, DozerField dest) { if (MappingUtils.isBlankOrNull(src.getName())) { return new EmptyFieldPropertyDescriptor(); } LOG.info("clazz = " + clazz.getName()); LOG.info("src.getTheGetMethod() = " + src.getTheGetMethod()); LOG.info("src.getTheSetMethod() = " + src.getTheSetMethod()); LOG.info("src.getMapGetMethod() = " + src.getMapGetMethod()); LOG.info("src.getMapSetMethod() = " + src.getMapSetMethod()); LOG.info("src.isAccessible() = " + src.isAccessible()); LOG.info("src.isIndexed() = " + src.isIndexed()); LOG.info("src.getIndex() = " + src.getIndex()); LOG.info("src.getName() = " + src.getName()); LOG.info("src.getKey() = " + src.getKey()); LOG.info("src.isSelfReferenced() = " + src.isSelfReferenced()); LOG.info("src.getName() = " + src.getName()); LOG.info("src.getDeepIndexHintContainer() = " + src.getDeepIndexHintContainer()); LOG.info("classMap.getDestClassBeanFactory() = " + classMap.getDestClassBeanFactory()); return getPropertyDescriptor(clazz, src.getTheGetMethod(), src.getTheSetMethod(), src.getMapGetMethod(), src.getMapSetMethod(), src.isAccessible(), src.isIndexed(), src.getIndex(), src.getName(), src .getKey(), src.isSelfReferenced(), src.getName(), src.getDeepIndexHintContainer(), classMap.getDestClassBeanFactory()); }
DozerField srcField = new DozerField(MappingUtils.isSupportedMap(srcClass) ? DozerConstants.SELF_KEYWORD : fieldName, null); srcField.setKey(fieldName); srcField.setMapGetMethod(classMap.getSrcClassMapGetMethod()); srcField.setMapSetMethod(classMap.getSrcClassMapSetMethod()); srcField.setName(DozerConstants.SELF_KEYWORD); DozerField destField = new DozerField(MappingUtils.isSupportedMap(destClass) ? DozerConstants.SELF_KEYWORD : fieldName, null); srcField.setKey(fieldName); destField.setMapGetMethod(classMap.getDestClassMapGetMethod()); destField.setMapSetMethod(classMap.getDestClassMapSetMethod()); destField.setName(DozerConstants.SELF_KEYWORD);
private static DozerField prepareField(String name, String type) { String fieldName; String fieldType = null; if (isIndexed(name)) { fieldName = getFieldNameOfIndexedField(name); } else { fieldName = name; } if (StringUtils.isNotEmpty(type)) { fieldType = type; } DozerField field = new DozerField(fieldName, fieldType); if (isIndexed(name)) { field.setIndexed(true); field.setIndex(getIndexOfIndexedField(name)); } return field; }
DozerField srcField = src.get(0); if (srcField.isMapTypeCustomGetterSetterField() || destField.isMapTypeCustomGetterSetterField() || classMap .isSrcClassMapTypeCustomGetterSetter() || classMap.isDestClassMapTypeCustomGetterSetter()) { result = new MapFieldMap(classMap); } else if (srcField.isCustomGetterSetterField() || destField.isCustomGetterSetterField()) { result = new CustomGetSetMethodFieldMap(classMap); } else if (MappingUtils.isBlankOrNull(srcField.getName())) { result = new EmptySourceFieldMap(classMap); } else {
public String getSrcFieldName() { return srcField.getName(); }
private static void addFieldMapping(ClassMap classMap, Configuration configuration, String srcName, String destName) { FieldMap fieldMap = new GenericFieldMap(classMap); DozerField sourceField = new DozerField(srcName, null); DozerField destField = new DozerField(destName, null); sourceField.setAccessible(true); destField.setAccessible(true); fieldMap.setSrcField(sourceField); fieldMap.setDestField(destField); // add CopyByReferences per defect #1728159 MappingUtils.applyGlobalCopyByReference(configuration, fieldMap, classMap); classMap.addFieldMapping(fieldMap); } }
public DozerField getSrcFieldCopy() { try { return (DozerField) srcField.clone(); } catch (CloneNotSupportedException e) { throw new MappingException(e); } }
public String getDestFieldMapGetMethod() { return !MappingUtils.isBlankOrNull(destField.getMapGetMethod()) ? destField.getMapGetMethod() : classMap .getDestClassMapGetMethod(); }
public String getSrcFieldMapSetMethod() { return !MappingUtils.isBlankOrNull(srcField.getMapSetMethod()) ? srcField.getMapSetMethod() : classMap .getSrcClassMapSetMethod(); }
public String getDestFieldKey() { return destField.getKey(); }
public String getDestFieldTheGetMethod() { return destField.getTheGetMethod(); }
public String getDateFormat() { if (!MappingUtils.isBlankOrNull(destField.getDateFormat())) { return destField.getDateFormat(); } else if (!MappingUtils.isBlankOrNull(srcField.getDateFormat())) { return srcField.getDateFormat(); } else { return classMap.getDateFormat(); } }
public static void addGenericMapping(ClassMap classMap, Configuration configuration, String srcName, String destName) { FieldMap fieldMap = new GenericFieldMap(classMap); fieldMap.setSrcField(new DozerField(srcName, null)); fieldMap.setDestField(new DozerField(destName, null)); // add CopyByReferences per defect #1728159 MappingUtils.applyGlobalCopyByReference(configuration, fieldMap, classMap); classMap.addFieldMapping(fieldMap); } }
if (MappingUtils.isBlankOrNull(src.getName())) { return new EmptyFieldPropertyDescriptor(); LOG.info("src.getTheGetMethod() = " + src.getTheGetMethod()); LOG.info("src.getTheSetMethod() = " + src.getTheSetMethod()); LOG.info("src.getMapGetMethod() = " + src.getMapGetMethod()); LOG.info("src.getMapSetMethod() = " + src.getMapSetMethod()); LOG.info("src.isAccessible() = " + src.isAccessible()); LOG.info("src.isIndexed() = " + src.isIndexed()); LOG.info("src.getIndex() = " + src.getIndex()); LOG.info("src.getName() = " + src.getName()); LOG.info("src.getKey() = " + src.getKey()); LOG.info("src.isSelfReferenced() = " + src.isSelfReferenced()); LOG.info("src.getName() = " + src.getName()); LOG.info("src.getDeepIndexHintContainer() = " + src.getDeepIndexHintContainer()); LOG.info("classMap.getDestClassBeanFactory() = " + classMap.getDestClassBeanFactory()); src.getTheGetMethod(), src.getTheSetMethod(), src.getMapGetMethod(), src.getMapSetMethod(), src.isAccessible(), src.isIndexed(), src.getIndex(), src.getName(), src.getKey(), src.isSelfReferenced(), src.getName(), src.getDeepIndexHintContainer(),