Class MappingDefinition
- java.lang.Object
-
- com.github.dozermapper.core.builder.model.jaxb.MappingDefinition
-
- Direct Known Subclasses:
ELMappingDefinition
public class MappingDefinition extends Object
Specifies a custom mapping definition between two classes(data types). All Mapping definitions are bi-directional by default. Global configuration element values are inheritedRequired 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.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringbeanFactoryprotected ClassDefinitionclassAprotected ClassDefinitionclassBprotected StringdateFormatprotected List<FieldExcludeDefinition>fieldExcludesprotected List<Object>fieldOrFieldExcludeprotected List<FieldDefinition>fieldsprotected BooleanmapEmptyStringprotected StringmapIdprotected BooleanmapNullprotected RelationshiprelationshipTypeprotected BooleanstopOnErrorsprotected BooleantrimStringsprotected Typetypeprotected Booleanwildcardprotected BooleanwildcardCaseInsensitive
-
Constructor Summary
Constructors Constructor Description MappingDefinition()MappingDefinition(MappingsDefinition parent)
-
Method Summary
-
-
-
Field Detail
-
classA
protected ClassDefinition classA
-
classB
protected ClassDefinition classB
-
fields
protected List<FieldDefinition> fields
-
fieldExcludes
protected List<FieldExcludeDefinition> fieldExcludes
-
dateFormat
protected String dateFormat
-
stopOnErrors
protected Boolean stopOnErrors
-
wildcard
protected Boolean wildcard
-
wildcardCaseInsensitive
protected Boolean wildcardCaseInsensitive
-
trimStrings
protected Boolean trimStrings
-
mapNull
protected Boolean mapNull
-
mapEmptyString
protected Boolean mapEmptyString
-
beanFactory
protected String beanFactory
-
type
protected Type type
-
relationshipType
protected Relationship relationshipType
-
mapId
protected String mapId
-
-
Constructor Detail
-
MappingDefinition
public MappingDefinition()
-
MappingDefinition
public MappingDefinition(MappingsDefinition parent)
-
-
Method Detail
-
withClassA
public ClassDefinition withClassA()
-
withClassB
public ClassDefinition withClassB()
-
withField
public FieldDefinition withField()
-
withFieldExclude
public FieldExcludeDefinition withFieldExclude()
-
withDateFormat
public MappingDefinition withDateFormat(String dateFormat)
-
withStopOnErrors
public MappingDefinition withStopOnErrors(Boolean stopOnErrors)
-
withWildcard
public MappingDefinition withWildcard(Boolean wildcard)
-
withWildcardCaseInsensitive
public MappingDefinition withWildcardCaseInsensitive(Boolean wildcardCaseInsensitive)
-
withTrimStrings
public MappingDefinition withTrimStrings(Boolean trimStrings)
-
withMapNull
public MappingDefinition withMapNull(Boolean mapNull)
-
withMapEmptyString
public MappingDefinition withMapEmptyString(Boolean mapEmptyString)
-
withBeanFactory
public MappingDefinition withBeanFactory(String beanFactory)
-
withType
public MappingDefinition withType(Type type)
-
withRelationshipType
public MappingDefinition withRelationshipType(Relationship relationshipType)
-
withMapId
public MappingDefinition withMapId(String mapId)
-
end
public MappingsDefinition end()
-
build
public ClassMap build(Configuration configuration, BeanContainer beanContainer, DestBeanCreator destBeanCreator, PropertyDescriptorFactory propertyDescriptorFactory)
-
getParent
public MappingsDefinition getParent()
-
getClassA
public ClassDefinition getClassA()
-
setClassA
protected void setClassA(ClassDefinition classA)
-
getClassB
public ClassDefinition getClassB()
-
setClassB
protected void setClassB(ClassDefinition classB)
-
getFields
public List<FieldDefinition> getFields()
-
setFields
protected void setFields(List<FieldDefinition> fields)
-
getFieldExcludes
public List<FieldExcludeDefinition> getFieldExcludes()
-
setFieldExcludes
protected void setFieldExcludes(List<FieldExcludeDefinition> fieldExcludes)
-
getDateFormat
public String getDateFormat()
-
setDateFormat
protected void setDateFormat(String dateFormat)
-
getStopOnErrors
public Boolean getStopOnErrors()
-
setStopOnErrors
protected void setStopOnErrors(Boolean stopOnErrors)
-
getWildcard
public Boolean getWildcard()
-
setWildcard
protected void setWildcard(Boolean wildcard)
-
getWildcardCaseInsensitive
public Boolean getWildcardCaseInsensitive()
-
setWildcardCaseInsensitive
protected void setWildcardCaseInsensitive(Boolean wildcardCaseInsensitive)
-
getTrimStrings
public Boolean getTrimStrings()
-
setTrimStrings
protected void setTrimStrings(Boolean trimStrings)
-
getMapNull
public Boolean getMapNull()
-
setMapNull
protected void setMapNull(Boolean mapNull)
-
getMapEmptyString
public Boolean getMapEmptyString()
-
setMapEmptyString
protected void setMapEmptyString(Boolean mapEmptyString)
-
getBeanFactory
public String getBeanFactory()
-
setBeanFactory
protected void setBeanFactory(String beanFactory)
-
getType
public Type getType()
-
setType
protected void setType(Type type)
-
getRelationshipType
public Relationship getRelationshipType()
-
setRelationshipType
protected void setRelationshipType(Relationship relationshipType)
-
getMapId
public String getMapId()
-
setMapId
protected void setMapId(String mapId)
-
-