Class FieldDefinition
- java.lang.Object
-
- com.github.dozermapper.core.builder.model.jaxb.FieldDefinition
-
- Direct Known Subclasses:
ELFieldDefinition
public class FieldDefinition extends Object
Specifies a custom field mapping. Fields that share the same attribute name do not need to be defined. Dozer automatically maps fields that match on attribute name. All Field Mapping definitions are bi-directional by default. Global configuration, Mapping, and ClassDefinition element values are inherited.Hints are used for mapping Collection types. A hint indicates which type of destination object should be created and added to the destination Collection.
Required Attributes:
Optional Attributes:
relationship-type For collections, indicates whether to add to existing values or to always replace any existing entries
remove-orphans For collections, indicates whether items that did not exist in the source collection should be removed from the destination collection.
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.
copy-by-reference Indicates whether the source field value is copied by reference or by value when populating the destination field. The default value is "false"
custom-converter Indicates that a specific custom converter should be used for mapping this field. Typically this will not be specified.
-
-
Field Summary
Fields Modifier and Type Field Description protected FieldDefinitionDefinitionaprotected StringaDeepIndexHintprotected StringaHintprotected FieldDefinitionDefinitionbprotected StringbDeepIndexHintprotected StringbHintprotected BooleancopyByReferenceprotected StringcustomConverterprotected StringcustomConverterIdprotected StringcustomConverterParamprotected StringmapIdprotected RelationshiprelationshipTypeprotected BooleanremoveOrphansprotected Typetype
-
Constructor Summary
Constructors Constructor Description FieldDefinition()FieldDefinition(MappingDefinition parentMappingDefinition)
-
Method Summary
-
-
-
Field Detail
-
a
protected FieldDefinitionDefinition a
-
b
protected FieldDefinitionDefinition b
-
aHint
protected String aHint
-
bHint
protected String bHint
-
aDeepIndexHint
protected String aDeepIndexHint
-
bDeepIndexHint
protected String bDeepIndexHint
-
relationshipType
protected Relationship relationshipType
-
removeOrphans
protected Boolean removeOrphans
-
type
protected Type type
-
mapId
protected String mapId
-
copyByReference
protected Boolean copyByReference
-
customConverter
protected String customConverter
-
customConverterId
protected String customConverterId
-
customConverterParam
protected String customConverterParam
-
-
Constructor Detail
-
FieldDefinition
public FieldDefinition()
-
FieldDefinition
public FieldDefinition(MappingDefinition parentMappingDefinition)
-
-
Method Detail
-
withA
public FieldDefinitionDefinition withA()
-
withB
public FieldDefinitionDefinition withB()
-
withAHint
public FieldDefinition withAHint(String aHint)
-
withBHint
public FieldDefinition withBHint(String bHint)
-
withADeepIndexHint
public FieldDefinition withADeepIndexHint(String aDeepIndexHint)
-
withBDeepIndexHint
public FieldDefinition withBDeepIndexHint(String bDeepIndexHint)
-
withRelationshipType
public FieldDefinition withRelationshipType(Relationship relationshipType)
-
withRemoveOrphans
public FieldDefinition withRemoveOrphans(Boolean removeOrphans)
-
withType
public FieldDefinition withType(Type type)
-
withMapId
public FieldDefinition withMapId(String mapId)
-
withCopyByReference
public FieldDefinition withCopyByReference(Boolean copyByReference)
-
withCustomConverter
public FieldDefinition withCustomConverter(String customConverter)
-
withCustomConverterId
public FieldDefinition withCustomConverterId(String customConverterId)
-
withCustomConverterParam
public FieldDefinition withCustomConverterParam(String customConverterParam)
-
end
public MappingDefinition end()
-
build
public FieldMap build(ClassMap classMap, BeanContainer beanContainer, DestBeanCreator destBeanCreator, PropertyDescriptorFactory propertyDescriptorFactory)
-
getParentMappingDefinition
public MappingDefinition getParentMappingDefinition()
-
getParentFieldExclude
public FieldExcludeDefinition getParentFieldExclude()
-
getA
public FieldDefinitionDefinition getA()
-
setA
protected void setA(FieldDefinitionDefinition a)
-
getB
public FieldDefinitionDefinition getB()
-
setB
protected void setB(FieldDefinitionDefinition b)
-
getAHint
public String getAHint()
-
setAHint
protected void setAHint(String aHint)
-
getBHint
public String getBHint()
-
setBHint
protected void setBHint(String bHint)
-
getADeepIndexHint
public String getADeepIndexHint()
-
setADeepIndexHint
protected void setADeepIndexHint(String aDeepIndexHint)
-
getBDeepIndexHint
public String getBDeepIndexHint()
-
setBDeepIndexHint
protected void setBDeepIndexHint(String bDeepIndexHint)
-
getRelationshipType
public Relationship getRelationshipType()
-
setRelationshipType
protected void setRelationshipType(Relationship relationshipType)
-
getRemoveOrphans
public Boolean getRemoveOrphans()
-
setRemoveOrphans
protected void setRemoveOrphans(Boolean removeOrphans)
-
getType
public Type getType()
-
setType
protected void setType(Type type)
-
getMapId
public String getMapId()
-
setMapId
protected void setMapId(String mapId)
-
getCopyByReference
public Boolean getCopyByReference()
-
setCopyByReference
protected void setCopyByReference(Boolean copyByReference)
-
getCustomConverter
public String getCustomConverter()
-
setCustomConverter
protected void setCustomConverter(String customConverter)
-
getCustomConverterId
public String getCustomConverterId()
-
setCustomConverterId
protected void setCustomConverterId(String customConverterId)
-
getCustomConverterParam
public String getCustomConverterParam()
-
setCustomConverterParam
protected void setCustomConverterParam(String customConverterParam)
-
-