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); } }
private 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); }
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 boolean apply(ClassMap classMap, Configuration configuration) { FieldMap fieldMap = new GenericFieldMap(classMap); DozerField selfReference = new DozerField(DozerConstants.SELF_KEYWORD, null); fieldMap.setSrcField(selfReference); fieldMap.setDestField(selfReference); classMap.addFieldMapping(fieldMap); return true; }
public boolean apply(ClassMap classMap, Configuration configuration) { FieldMap fieldMap = new GenericFieldMap(classMap); DozerField selfReference = new DozerField(DozerConstants.SELF_KEYWORD, null); fieldMap.setSrcField(selfReference); fieldMap.setDestField(selfReference); classMap.addFieldMapping(fieldMap); return true; } }
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); }
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; }
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; }
private static DozerField prepareField(String name, String type) { if (MappingUtils.isBlankOrNull(name)) { throw new MappingException("Field name can not be empty"); } 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; }
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 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; }
DozerField srcField = new DozerField(MappingUtils.isSupportedMap(srcClass) ? DozerConstants.SELF_KEYWORD : fieldName, null); srcField.setKey(fieldName); DozerField destField = new DozerField(MappingUtils.isSupportedMap(destClass) ? DozerConstants.SELF_KEYWORD : fieldName, null); srcField.setKey(fieldName);
DozerField srcField = new DozerField( MappingUtils.isSupportedMap(srcClass) ? DozerConstants.SELF_KEYWORD : fieldName, null); srcField.setKey(fieldName); DozerField destField = new DozerField( MappingUtils.isSupportedMap(destClass) ? DozerConstants.SELF_KEYWORD : fieldName, null); srcField.setKey(fieldName);