public class MappingDefinition extends Object
Required Attributes:
Optional Attributes:
date-format The string format of Date fields. This is used for field mapping between Strings and Dates
stop-on-errors Indicates whether Dozer should stop mapping fields and throw the Exception if an error is encountered while performing a field mapping. It is recommended that this is set to "true". If set to "false", Dozer will trap the exception, log the error, and then continue mapping subsequent fields The default value is "true"
wildcard Indicates whether Dozer automatically map fields that have the same name. The default value is "true"
wildcard-case-insensitive Indicates whether Dozer should ignore the case of field names when applying wildcard mapping. The default value is "false"
trim-strings Indicates whether Dozer automatically trims String values prior to setting the destination value. The default value is "false"
map-null Indicates whether null values are mapped. The default value is "true"
map-empty-string Indicates whether empty string values are mapped. The default value is "true"
bean-factory The factory class to create data objects. This typically will not be specified. By default Dozer constructs new instances of data objects by invoking the no-arg constructor
type Indicates whether this mapping is bi-directional or only one-way. Typically this will be set to bi-directional. The default is "bi-directional".
map-id The id that uniquely identifies this mapping definition. This typically will not be specified. You would only need to specify this for only need this for special context based mapping and when mapping between Map objects and Custom Data Objects.
relationship-type Indications whether collections are mapped cumulative or non-cumulative. cumulative indicates the element is added to the collection.
non-cumulative indicates the element will be added or an existing entry will be updated.
| Modifier and Type | Field and Description |
|---|---|
protected String |
beanFactory |
protected ClassDefinition |
classA |
protected ClassDefinition |
classB |
protected String |
dateFormat |
protected List<FieldExcludeDefinition> |
fieldExcludes |
protected List<Object> |
fieldOrFieldExclude |
protected List<FieldDefinition> |
fields |
protected Boolean |
mapEmptyString |
protected String |
mapId |
protected Boolean |
mapNull |
protected Relationship |
relationshipType |
protected Boolean |
stopOnErrors |
protected Boolean |
trimStrings |
protected Type |
type |
protected Boolean |
wildcard |
protected Boolean |
wildcardCaseInsensitive |
| Constructor and Description |
|---|
MappingDefinition() |
MappingDefinition(MappingsDefinition parent) |
protected ClassDefinition classA
protected ClassDefinition classB
protected List<FieldDefinition> fields
protected List<FieldExcludeDefinition> fieldExcludes
protected String dateFormat
protected Boolean stopOnErrors
protected Boolean wildcard
protected Boolean wildcardCaseInsensitive
protected Boolean trimStrings
protected Boolean mapNull
protected Boolean mapEmptyString
protected String beanFactory
protected Type type
protected Relationship relationshipType
protected String mapId
public MappingDefinition()
public MappingDefinition(MappingsDefinition parent)
public ClassDefinition withClassA()
public ClassDefinition withClassB()
public FieldDefinition withField()
public FieldExcludeDefinition withFieldExclude()
public MappingDefinition withDateFormat(String dateFormat)
public MappingDefinition withStopOnErrors(Boolean stopOnErrors)
public MappingDefinition withWildcard(Boolean wildcard)
public MappingDefinition withWildcardCaseInsensitive(Boolean wildcardCaseInsensitive)
public MappingDefinition withTrimStrings(Boolean trimStrings)
public MappingDefinition withMapNull(Boolean mapNull)
public MappingDefinition withMapEmptyString(Boolean mapEmptyString)
public MappingDefinition withBeanFactory(String beanFactory)
public MappingDefinition withType(Type type)
public MappingDefinition withRelationshipType(Relationship relationshipType)
public MappingDefinition withMapId(String mapId)
public MappingsDefinition end()
public ClassMap build(Configuration configuration, BeanContainer beanContainer, DestBeanCreator destBeanCreator, PropertyDescriptorFactory propertyDescriptorFactory)
Copyright © 2005–2021 dozer. All rights reserved.