public class FieldDefinition extends Object
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.
| Modifier and Type | Field and Description |
|---|---|
protected FieldDefinitionDefinition |
a |
protected String |
aDeepIndexHint |
protected String |
aHint |
protected FieldDefinitionDefinition |
b |
protected String |
bDeepIndexHint |
protected String |
bHint |
protected Boolean |
copyByReference |
protected String |
customConverter |
protected String |
customConverterId |
protected String |
customConverterParam |
protected String |
mapId |
protected Relationship |
relationshipType |
protected Boolean |
removeOrphans |
protected Type |
type |
| Constructor and Description |
|---|
FieldDefinition() |
FieldDefinition(MappingDefinition parentMappingDefinition) |
| Modifier and Type | Method and Description |
|---|---|
FieldMap |
build(ClassMap classMap,
BeanContainer beanContainer,
DestBeanCreator destBeanCreator,
PropertyDescriptorFactory propertyDescriptorFactory) |
MappingDefinition |
end() |
FieldDefinitionDefinition |
withA() |
FieldDefinition |
withADeepIndexHint(String aDeepIndexHint) |
FieldDefinition |
withAHint(String aHint) |
FieldDefinitionDefinition |
withB() |
FieldDefinition |
withBDeepIndexHint(String bDeepIndexHint) |
FieldDefinition |
withBHint(String bHint) |
FieldDefinition |
withCopyByReference(Boolean copyByReference) |
FieldDefinition |
withCustomConverter(String customConverter) |
FieldDefinition |
withCustomConverterId(String customConverterId) |
FieldDefinition |
withCustomConverterParam(String customConverterParam) |
FieldDefinition |
withMapId(String mapId) |
FieldDefinition |
withRelationshipType(Relationship relationshipType) |
FieldDefinition |
withRemoveOrphans(Boolean removeOrphans) |
FieldDefinition |
withType(Type type) |
protected FieldDefinitionDefinition a
protected FieldDefinitionDefinition b
protected String aHint
protected String bHint
protected String aDeepIndexHint
protected String bDeepIndexHint
protected Relationship relationshipType
protected Boolean removeOrphans
protected Type type
protected String mapId
protected Boolean copyByReference
protected String customConverter
protected String customConverterId
protected String customConverterParam
public FieldDefinition()
public FieldDefinition(MappingDefinition parentMappingDefinition)
public FieldDefinitionDefinition withA()
public FieldDefinitionDefinition withB()
public FieldDefinition withAHint(String aHint)
public FieldDefinition withBHint(String bHint)
public FieldDefinition withADeepIndexHint(String aDeepIndexHint)
public FieldDefinition withBDeepIndexHint(String bDeepIndexHint)
public FieldDefinition withRelationshipType(Relationship relationshipType)
public FieldDefinition withRemoveOrphans(Boolean removeOrphans)
public FieldDefinition withType(Type type)
public FieldDefinition withMapId(String mapId)
public FieldDefinition withCopyByReference(Boolean copyByReference)
public FieldDefinition withCustomConverter(String customConverter)
public FieldDefinition withCustomConverterId(String customConverterId)
public FieldDefinition withCustomConverterParam(String customConverterParam)
public MappingDefinition end()
public FieldMap build(ClassMap classMap, BeanContainer beanContainer, DestBeanCreator destBeanCreator, PropertyDescriptorFactory propertyDescriptorFactory)
Copyright © 2005–2021 dozer. All rights reserved.