ma.glasnost.orika.metadata
Class FieldMapBuilder<A,B>

java.lang.Object
  extended by ma.glasnost.orika.metadata.FieldMapBuilder<A,B>
Type Parameters:
A -
B -

public class FieldMapBuilder<A,B>
extends Object

FieldMapBuilder is used in cooperation with the ClassMapBuilder fluent api to configure the details of a given FieldMap instance.

A FieldMapBuilder instance is obtained from a ClassMapBuilder instance via the fieldMap(...) method; it may then be used to further configure that field mapping. Finally, the add() is used to add the associated field mapping to the containing ClassMapBuilder.


Method Summary
 ClassMapBuilder<A,B> add()
          Adds the FieldMap configured by this builder to it's containing ClassMapBuilder; use this method to complete specifications on a given field mapping and return to the containing builder.
 FieldMapBuilder<A,B> aElementType(Class<?> rawType)
          Specify element type for A side property
When dealing with legacy code, prior to Java 1.5 you can add element type of collections, this is not required when using generics
 FieldMapBuilder<A,B> aElementType(Type<?> elementType)
          Specify element type for A side property
When dealing with legacy code, prior to Java 1.5 you can add element type of collections, this is not required when using generics
 FieldMapBuilder<A,B> aInverse(String aInverse)
           
 FieldMapBuilder<A,B> aToB()
          Specify that the configured field mapping (property) should only be used when mapping in the direction from A to B
 FieldMapBuilder<A,B> bElementType(Class<?> rawType)
          Specify element type for B side property
When dealing with legacy code, prior to Java 1.5 you can add element type of collections, this is not required when using generics
 FieldMapBuilder<A,B> bElementType(Type<?> elementType)
          Specify element type for B side property
When dealing with legacy code, prior to Java 1.5 you can add element type of collections, this is not required when using generics
 FieldMapBuilder<A,B> bInverse(String bInverse)
           
 FieldMapBuilder<A,B> bToA()
          Specify that the configured field mapping (property) should only be used when mapping in the direction from B to A
 FieldMapBuilder<A,B> converter(String id)
          Specify that the converter (which was previously registered with the specified id) should be applied to this specific field mapping.
 FieldMapBuilder<A,B> exclude()
          Specify that the property should be excluded from mapping
static FieldMap mapKeys(Type<?> aType, Type<?> bType)
           
 FieldMapBuilder<A,B> mapNulls(boolean destinationMappedOnNull)
           
 FieldMapBuilder<A,B> mapNullsInReverse(boolean sourceMappedOnNull)
           
static FieldMap mapValues(Type<?> aType, Type<?> bType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

add

public ClassMapBuilder<A,B> add()
Adds the FieldMap configured by this builder to it's containing ClassMapBuilder; use this method to complete specifications on a given field mapping and return to the containing builder.

Returns:
the containing ClassMapBuilder instance

aInverse

public FieldMapBuilder<A,B> aInverse(String aInverse)
Parameters:
aInverse -
Returns:

bInverse

public FieldMapBuilder<A,B> bInverse(String bInverse)
Parameters:
bInverse -
Returns:

mapNullsInReverse

public FieldMapBuilder<A,B> mapNullsInReverse(boolean sourceMappedOnNull)
Parameters:
sourceMappedOnNull - true|false to indicate whether the source property of this field map should be set to null (when mapping in the reverse direction) if the destination property's value is null
Returns:
this FieldMapBuilder

mapNulls

public FieldMapBuilder<A,B> mapNulls(boolean destinationMappedOnNull)
Parameters:
destinationMappedOnNull - true|false to indicate whether the destination property of this field map should be set to null (when mapping in the forward direction) if the source property's value is null
Returns:
this FieldMapBuilder

aToB

public FieldMapBuilder<A,B> aToB()
Specify that the configured field mapping (property) should only be used when mapping in the direction from A to B

Returns:

bToA

public FieldMapBuilder<A,B> bToA()
Specify that the configured field mapping (property) should only be used when mapping in the direction from B to A

Returns:

converter

public FieldMapBuilder<A,B> converter(String id)
Specify that the converter (which was previously registered with the specified id) should be applied to this specific field mapping.

Parameters:
id - the id with which the converter to use was registered
Returns:

exclude

public FieldMapBuilder<A,B> exclude()
Specify that the property should be excluded from mapping


aElementType

public FieldMapBuilder<A,B> aElementType(Class<?> rawType)
Specify element type for A side property
When dealing with legacy code, prior to Java 1.5 you can add element type of collections, this is not required when using generics


aElementType

public FieldMapBuilder<A,B> aElementType(Type<?> elementType)
Specify element type for A side property
When dealing with legacy code, prior to Java 1.5 you can add element type of collections, this is not required when using generics


bElementType

public FieldMapBuilder<A,B> bElementType(Class<?> rawType)
Specify element type for B side property
When dealing with legacy code, prior to Java 1.5 you can add element type of collections, this is not required when using generics


bElementType

public FieldMapBuilder<A,B> bElementType(Type<?> elementType)
Specify element type for B side property
When dealing with legacy code, prior to Java 1.5 you can add element type of collections, this is not required when using generics


mapKeys

public static FieldMap mapKeys(Type<?> aType,
                               Type<?> bType)

mapValues

public static FieldMap mapValues(Type<?> aType,
                                 Type<?> bType)


Copyright © 2013 Glasnost. All Rights Reserved.