public ConfigurationBuilder copyByReference(String typeMask) { CopyByReference copyByReference = new CopyByReference(typeMask); configuration.getCopyByReferences().add(copyByReference); return this; }
private static void generateMapping(ClassMap classMap, Configuration configuration, List<ClassMappingGenerator> mappingGenerators) { if (!classMap.isWildcard()) { return; } for (ClassMappingGenerator generator : mappingGenerators) { if (generator.accepts(classMap)) { if (generator.apply(classMap, configuration)) { return; } } } }
private ClassMap getClassMap(Class<?> srcClass, Class<?> destClass, String mapId) { ClassMap mapping = classMappings.find(srcClass, destClass, mapId); if (mapping == null) { // If mapping not found in existing custom mapping collection, create // default as an explicit mapping must not // exist. The create default class map method will also add all default // mappings that it can determine. mapping = ClassMapBuilder.createDefaultClassMap(globalConfiguration, srcClass, destClass); classMappings.addDefault(srcClass, destClass, mapping); } return mapping; }
public static void applyGlobalCopyByReference(Configuration globalConfig, FieldMap fieldMap, ClassMap classMap) { CopyByReferenceContainer copyByReferenceContainer = globalConfig.getCopyByReferences(); String destFieldTypeName = null; Class<?> clazz = fieldMap.getDestFieldType(classMap.getDestClassToMap()); if (clazz != null) { destFieldTypeName = clazz.getName(); } if (copyByReferenceContainer.contains(destFieldTypeName) && !fieldMap.isCopyByReferenceOveridden()) { fieldMap.setCopyByReference(true); } }
public List<Class<RuntimeException>> getAllowedExceptions() { if (!allowedExceptions.isEmpty()) { return allowedExceptions; } else { return globalConfiguration.getAllowedExceptions().getExceptions(); } }
public ConfigurationBuilder configuration() { Configuration configuration = new Configuration(); data.setConfiguration(configuration); return new ConfigurationBuilder(configuration); }
public void relationshipType(RelationshipType value) { if (value == null) { configuration.setRelationshipType(DozerConstants.DEFAULT_RELATIONSHIP_TYPE_POLICY); } else { configuration.setRelationshipType(value); } }
public MappingBuilder mapNull(boolean value) { classMap.setMapNull(value); return this; }
public MappingBuilder relationshipType(RelationshipType type) { classMap.setRelationshipType(type); return this; }
public MappingBuilder mapId(String id) { classMap.setMapId(id); return this; }
public MappingBuilder type(MappingDirection type) { classMap.setType(type); return this; }
public boolean contains(String typeName) { for (CopyByReference reference : copyByReferences) { if (reference.matches(typeName)) { return true; } } return false; }
public ConfigurationBuilder copyByReference(String typeMask) { CopyByReference copyByReference = new CopyByReference(typeMask); configuration.getCopyByReferences().add(copyByReference); return this; }
public static void applyGlobalCopyByReference(Configuration globalConfig, FieldMap fieldMap, ClassMap classMap) { CopyByReferenceContainer copyByReferenceContainer = globalConfig.getCopyByReferences(); String destFieldTypeName = null; Class<?> clazz = fieldMap.getDestFieldType(classMap.getDestClassToMap()); if (clazz != null) { destFieldTypeName = clazz.getName(); } if (copyByReferenceContainer.contains(destFieldTypeName) && !fieldMap.isCopyByReferenceOveridden()) { fieldMap.setCopyByReference(true); } }
private static void generateMapping(ClassMap classMap, Configuration configuration, List<ClassMappingGenerator> mappingGenerators) { if (!classMap.isWildcard()) { return; } for (ClassMappingGenerator generator : mappingGenerators) { if (generator.accepts(classMap)) { if (generator.apply(classMap, configuration)) { return; } } } }
public List<Class<RuntimeException>> getAllowedExceptions() { if (!allowedExceptions.isEmpty()) { return allowedExceptions; } else { return globalConfiguration.getAllowedExceptions().getExceptions(); } }
public void relationshipType(RelationshipType value) { if (value == null) { configuration.setRelationshipType(DozerConstants.DEFAULT_RELATIONSHIP_TYPE_POLICY); } else { configuration.setRelationshipType(value); } }
public boolean contains(String typeName) { for (CopyByReference reference : copyByReferences) { if (reference.matches(typeName)) { return true; } } return false; }
public ConfigurationBuilder copyByReference(String typeMask) { CopyByReference copyByReference = new CopyByReference(typeMask); configuration.getCopyByReferences().add(copyByReference); return this; }
public void relationshipType(RelationshipType value) { if (value == null) { configuration.setRelationshipType(DozerConstants.DEFAULT_RELATIONSHIP_TYPE_POLICY); } else { configuration.setRelationshipType(value); } }