ma.glasnost.orika.impl.mapping.strategy
Class InstantiateAndUseCustomMapperStrategy

java.lang.Object
  extended by ma.glasnost.orika.impl.mapping.strategy.AbstractMappingStrategy
      extended by ma.glasnost.orika.impl.mapping.strategy.UseCustomMapperStrategy
          extended by ma.glasnost.orika.impl.mapping.strategy.InstantiateAndUseCustomMapperStrategy
All Implemented Interfaces:
MappingStrategy

public class InstantiateAndUseCustomMapperStrategy
extends UseCustomMapperStrategy

InstantiateAndUseCustomMapperStrategy uses a custom ObjectFactory and a custom Mapper to map from source to destination type.


Field Summary
protected  ObjectFactory<Object> objectFactory
          The custom ObjectFactory used by this strategy
 
Fields inherited from class ma.glasnost.orika.impl.mapping.strategy.UseCustomMapperStrategy
customMapper, unenhancer
 
Fields inherited from class ma.glasnost.orika.impl.mapping.strategy.AbstractMappingStrategy
destinationType, sourceType
 
Constructor Summary
InstantiateAndUseCustomMapperStrategy(Type<Object> sourceType, Type<Object> destinationType, Mapper<Object,Object> customMapper, ObjectFactory<Object> objectFactory, UnenhanceStrategy unenhancer)
          Creates a new instance of InstantiateAndUseCustomMapperStrategy
 
Method Summary
protected  Object getInstance(Object sourceObject, Object destinationObject, MappingContext context)
          Gets an instance of the destination object to be mapped; may return the provided destinationObject for map-in-place scenarios
 
Methods inherited from class ma.glasnost.orika.impl.mapping.strategy.UseCustomMapperStrategy
map
 
Methods inherited from class ma.glasnost.orika.impl.mapping.strategy.AbstractMappingStrategy
getDestinationType, getSoureType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

objectFactory

protected final ObjectFactory<Object> objectFactory
The custom ObjectFactory used by this strategy

Constructor Detail

InstantiateAndUseCustomMapperStrategy

public InstantiateAndUseCustomMapperStrategy(Type<Object> sourceType,
                                             Type<Object> destinationType,
                                             Mapper<Object,Object> customMapper,
                                             ObjectFactory<Object> objectFactory,
                                             UnenhanceStrategy unenhancer)
Creates a new instance of InstantiateAndUseCustomMapperStrategy

Parameters:
sourceType -
destinationType -
customMapper -
objectFactory -
unenhancer -
Method Detail

getInstance

protected Object getInstance(Object sourceObject,
                             Object destinationObject,
                             MappingContext context)
Description copied from class: UseCustomMapperStrategy
Gets an instance of the destination object to be mapped; may return the provided destinationObject for map-in-place scenarios

Specified by:
getInstance in class UseCustomMapperStrategy
Returns:
an instance of the destination type to be mapped


Copyright © 2013 Glasnost. All Rights Reserved.