ma.glasnost.orika
Class CustomMapper<A,B>

java.lang.Object
  extended by ma.glasnost.orika.CustomMapper<A,B>
All Implemented Interfaces:
MappedTypePair<A,B>, Mapper<A,B>
Direct Known Subclasses:
MapperBase.MapperBaseAdapter

public abstract class CustomMapper<A,B>
extends Object
implements Mapper<A,B>

Abstract super-class for all generated mappers and user custom mappers.

Author:
S.M. El Aatifi
See Also:
ClassMapBuilder

Field Summary
protected  Type<A> aType
           
protected  Type<B> bType
           
protected  MapperFacade mapperFacade
           
 
Constructor Summary
CustomMapper()
           
 
Method Summary
 Type<A> getAType()
           
 Type<B> getBType()
           
 void mapAtoB(A a, B b, MappingContext context)
          Maps the properties of an instance of type A to the properties of an instance of type B.
 void mapBtoA(B b, A a, MappingContext context)
          Maps the properties of an instance of type B to the properties of an instance of type A.
 void setMapperFacade(MapperFacade mapperFacade)
          Store an instance of the current MapperFacade which may be used in mapping of nested types.
 void setUsedMappers(Mapper<Object,Object>[] mapper)
          Store the set of custom mappers used by this mapper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aType

protected Type<A> aType

bType

protected Type<B> bType

mapperFacade

protected MapperFacade mapperFacade
Constructor Detail

CustomMapper

public CustomMapper()
Method Detail

mapAtoB

public void mapAtoB(A a,
                    B b,
                    MappingContext context)
Description copied from interface: Mapper
Maps the properties of an instance of type A to the properties of an instance of type B.

Specified by:
mapAtoB in interface Mapper<A,B>
Parameters:
a - the object from which to read the properties
b - the object onto which the properties should be mapped

mapBtoA

public void mapBtoA(B b,
                    A a,
                    MappingContext context)
Description copied from interface: Mapper
Maps the properties of an instance of type B to the properties of an instance of type A.

Specified by:
mapBtoA in interface Mapper<A,B>
Parameters:
b - the object from which to read the properties
a - the object onto which the properties should be mapped

getAType

public Type<A> getAType()
Specified by:
getAType in interface MappedTypePair<A,B>
Returns:
the 'A' type for this mapped pair

getBType

public Type<B> getBType()
Specified by:
getBType in interface MappedTypePair<A,B>
Returns:
the 'B' type for this mapped pair

setMapperFacade

public void setMapperFacade(MapperFacade mapperFacade)
Description copied from interface: Mapper
Store an instance of the current MapperFacade which may be used in mapping of nested types.

Specified by:
setMapperFacade in interface Mapper<A,B>

setUsedMappers

public void setUsedMappers(Mapper<Object,Object>[] mapper)
Description copied from interface: Mapper
Store the set of custom mappers used by this mapper.

Specified by:
setUsedMappers in interface Mapper<A,B>


Copyright © 2013 Glasnost. All Rights Reserved.