public class ConfigurableMapper extends Object implements MapperFacade
configure(MapperFactory) method to provide the necessary
initializations and customizations desired.configureFactoryBuilder(ma.glasnost.orika.impl.DefaultMapperFactory.Builder)
method may be overridden to apply custom parameters to the builder used to
obtain the MapperFactory.
public class MyCustomMapper extends ConfigurableMapper {
protected void configure(MapperFactory factory) {
factory.registerClassMapping(...);
factory.getConverterFactory().registerConverter(...);
factory.registerDefaultMappingHint(...);
}
}
...
public class SomeOtherClass {
private MapperFacade mapper = new MyCustomMapper();
void someMethod() {
mapper.map(blah, Blah.class);
...
}
...
}
| Constructor and Description |
|---|
ConfigurableMapper() |
ConfigurableMapper(boolean autoInit) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configure(MapperFactory factory)
Implement this method to provide your own configurations to the Orika
MapperFactory used by this mapper.
|
protected void |
configureFactoryBuilder(DefaultMapperFactory.Builder factoryBuilder)
Override this method only if you need to customize any of the parameters
passed to the factory builder, in the case that you've provided your own
custom implementation of one of the core components of Orika.
|
<S,D> D |
convert(S source,
Class<D> destinationClass,
String converterId,
MappingContext context)
Convert the source object into the appropriate destination type
|
<S,D> D |
convert(S source,
Type<S> sourceType,
Type<D> destinationType,
String converterId,
MappingContext context)
Convert the source object into the appropriate destination type
|
<A,B> BoundMapperFacade<A,B> |
dedicatedMapperFor(Class<A> aType,
Class<B> bType) |
<A,B> BoundMapperFacade<A,B> |
dedicatedMapperFor(Class<A> aType,
Class<B> bType,
boolean containsCycles) |
<S,D> BoundMapperFacade<S,D> |
dedicatedMapperFor(Type<S> sourceType,
Type<D> destinationType) |
<S,D> BoundMapperFacade<S,D> |
dedicatedMapperFor(Type<S> sourceType,
Type<D> destinationType,
boolean containsCycles) |
void |
factoryModified(MapperFactory factory)
Notifies the MapperFacade that a MapperFactory associated with it has
been modified.
|
protected void |
init() |
<S,D> D |
map(S sourceObject,
Class<D> destinationClass)
Delegate methods for MapperFacade;
|
<S,D> D |
map(S sourceObject,
Class<D> destinationClass,
MappingContext context)
Create and return a new instance of type D mapped with the properties of
sourceObject. |
<S,D> void |
map(S sourceObject,
D destinationObject)
Maps the properties of
sourceObject onto
destinationObject. |
<S,D> void |
map(S sourceObject,
D destinationObject,
MappingContext context)
Maps the properties of
sourceObject onto
destinationObject. |
<S,D> void |
map(S sourceObject,
D destinationObject,
Type<S> sourceType,
Type<D> destinationType)
Maps the properties of
sourceObject onto
destinationObject, using sourceType and
destinationType to specify the parameterized types of the
source and destination object. |
<S,D> void |
map(S sourceObject,
D destinationObject,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
Maps the properties of
sourceObject onto
destinationObject, using sourceType and
destinationType to specify the parameterized types of the
source and destination object. |
<S,D> D |
map(S sourceObject,
Type<S> sourceType,
Type<D> destinationType)
Create and return a new instance of type D mapped with the properties of
sourceObject. |
<S,D> D |
map(S sourceObject,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
Create and return a new instance of type D mapped with the properties of
sourceObject. |
<S,D> D[] |
mapAsArray(D[] destination,
Iterable<S> source,
Class<D> destinationClass)
Maps the source interable into a new Array of type
D. |
<S,D> D[] |
mapAsArray(D[] destination,
Iterable<S> source,
Class<D> destinationClass,
MappingContext context)
Maps the source Iterable into a new Array of type
D. |
<S,D> D[] |
mapAsArray(D[] destination,
Iterable<S> source,
Type<S> sourceType,
Type<D> destinationType)
Maps the source Array into a new List parameterized by
destinationType. |
<S,D> D[] |
mapAsArray(D[] destination,
Iterable<S> source,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
Maps the source Iterable into the destination Array
|
<Sk,Sv,D> D[] |
mapAsArray(D[] destination,
Map<Sk,Sv> source,
Type<? extends Map<Sk,Sv>> sourceType,
Type<D> destinationType)
Map from a java.util.Map to a Set
|
<Sk,Sv,D> D[] |
mapAsArray(D[] destination,
Map<Sk,Sv> source,
Type<? extends Map<Sk,Sv>> sourceType,
Type<D> destinationType,
MappingContext context)
Map from a java.util.Map to a Set
|
<S,D> D[] |
mapAsArray(D[] destination,
S[] source,
Class<D> destinationClass)
Maps the source array into a new Array of type
D. |
<S,D> D[] |
mapAsArray(D[] destination,
S[] source,
Class<D> destinationClass,
MappingContext context)
Maps the source Array into a new Array of type
D. |
<S,D> D[] |
mapAsArray(D[] destination,
S[] source,
Type<S> sourceType,
Type<D> destinationType)
Maps the source Array into a new List parameterized by
destinationType. |
<S,D> D[] |
mapAsArray(D[] destination,
S[] source,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
Maps the source Array into the destination Array
|
<S,D> void |
mapAsCollection(Iterable<S> source,
Collection<D> destination,
Class<D> destinationClass)
Maps the source Iterable into the destination Collection
|
<S,D> void |
mapAsCollection(Iterable<S> source,
Collection<D> destination,
Class<D> destinationClass,
MappingContext context)
Map an iterable onto an existing collection
|
<S,D> void |
mapAsCollection(Iterable<S> source,
Collection<D> destination,
Type<S> sourceType,
Type<D> destinationType)
Map an iterable onto an existing collection
|
<S,D> void |
mapAsCollection(Iterable<S> source,
Collection<D> destination,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
Map an iterable onto an existing collection
|
<S,D> void |
mapAsCollection(S[] source,
Collection<D> destination,
Class<D> destinationCollection)
Map an array onto an existing collection
|
<S,D> void |
mapAsCollection(S[] source,
Collection<D> destination,
Class<D> destinationCollection,
MappingContext context)
Map an array onto an existing collection
|
<S,D> void |
mapAsCollection(S[] source,
Collection<D> destination,
Type<S> sourceType,
Type<D> destinationType)
Map an array onto an existing collection
|
<S,D> void |
mapAsCollection(S[] source,
Collection<D> destination,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
Map an array onto an existing collection
|
<S,D> List<D> |
mapAsList(Iterable<S> source,
Class<D> destinationClass)
Maps the source Iterable into a new List parameterized by
destinationClass. |
<S,D> List<D> |
mapAsList(Iterable<S> source,
Class<D> destinationClass,
MappingContext context)
Maps the source Iterable into a new List parameterized by
destinationClass. |
<S,D> List<D> |
mapAsList(Iterable<S> source,
Type<S> sourceType,
Type<D> destinationType)
Maps the source Iterable into a new List parameterized by
destinationType. |
<S,D> List<D> |
mapAsList(Iterable<S> source,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
Maps the source Iterable into a new List parameterized by
destinationType. |
<Sk,Sv,D> List<D> |
mapAsList(Map<Sk,Sv> source,
Type<? extends Map<Sk,Sv>> sourceType,
Type<D> destinationType)
Map from a java.util.Map to a List
|
<Sk,Sv,D> List<D> |
mapAsList(Map<Sk,Sv> source,
Type<? extends Map<Sk,Sv>> sourceType,
Type<D> destinationType,
MappingContext context)
Map from a java.util.Map to a List
|
<S,D> List<D> |
mapAsList(S[] source,
Class<D> destinationClass)
Maps the source Array into a new List parameterized by
destinationClass. |
<S,D> List<D> |
mapAsList(S[] source,
Class<D> destinationClass,
MappingContext context)
Maps the source Array into a new List parameterized by
destinationClass. |
<S,D> List<D> |
mapAsList(S[] source,
Type<S> sourceType,
Type<D> destinationType)
Maps the source Array into a new List parameterized by
destinationType. |
<S,D> List<D> |
mapAsList(S[] source,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
Maps the source Array into a new List parameterized by
destinationType. |
<S,Dk,Dv> Map<Dk,Dv> |
mapAsMap(Iterable<S> source,
Type<S> sourceType,
Type<? extends Map<Dk,Dv>> destinationType)
Map from an Iterable to an instance of java.util.Map.
|
<S,Dk,Dv> Map<Dk,Dv> |
mapAsMap(Iterable<S> source,
Type<S> sourceType,
Type<? extends Map<Dk,Dv>> destinationType,
MappingContext context)
Map from an Iterable to an instance of java.util.Map.
|
<Sk,Sv,Dk,Dv> |
mapAsMap(Map<Sk,Sv> source,
Type<? extends Map<Sk,Sv>> sourceType,
Type<? extends Map<Dk,Dv>> destinationType)
Map from one instance of java.util.Map to another.
|
<Sk,Sv,Dk,Dv> |
mapAsMap(Map<Sk,Sv> source,
Type<? extends Map<Sk,Sv>> sourceType,
Type<? extends Map<Dk,Dv>> destinationType,
MappingContext context)
Map from one instance of java.util.Map to another.
|
<S,Dk,Dv> Map<Dk,Dv> |
mapAsMap(S[] source,
Type<S> sourceType,
Type<? extends Map<Dk,Dv>> destinationType)
Map from an Array to an instance of java.util.Map.
|
<S,Dk,Dv> Map<Dk,Dv> |
mapAsMap(S[] source,
Type<S> sourceType,
Type<? extends Map<Dk,Dv>> destinationType,
MappingContext context)
Map from an Array to an instance of java.util.Map.
|
<S,D> Set<D> |
mapAsSet(Iterable<S> source,
Class<D> destinationClass)
Maps the source iterable into a new Set parameterized by
destinationClass. |
<S,D> Set<D> |
mapAsSet(Iterable<S> source,
Class<D> destinationClass,
MappingContext context)
Maps the source iterable into a new Set parameterized by
destinationClass. |
<S,D> Set<D> |
mapAsSet(Iterable<S> source,
Type<S> sourceType,
Type<D> destinationType)
Maps the source Iterable into a new Set parameterized by
destinationType. |
<S,D> Set<D> |
mapAsSet(Iterable<S> source,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
Maps the source Iterable into a new Set parameterized by
destinationType. |
<Sk,Sv,D> Set<D> |
mapAsSet(Map<Sk,Sv> source,
Type<? extends Map<Sk,Sv>> sourceType,
Type<D> destinationType)
Map from a java.util.Map to a Set
|
<Sk,Sv,D> Set<D> |
mapAsSet(Map<Sk,Sv> source,
Type<? extends Map<Sk,Sv>> sourceType,
Type<D> destinationType,
MappingContext context)
Map from a java.util.Map to a Set
|
<S,D> Set<D> |
mapAsSet(S[] source,
Class<D> destinationClass)
Maps the source Array into a new Set parameterized by
destinationClass. |
<S,D> Set<D> |
mapAsSet(S[] source,
Class<D> destinationClass,
MappingContext context)
Maps the source Array into a new Set parameterized by
destinationClass. |
<S,D> Set<D> |
mapAsSet(S[] source,
Type<S> sourceType,
Type<D> destinationType)
Maps the source Array into a new Set parameterized by
destinationType. |
<S,D> Set<D> |
mapAsSet(S[] source,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
Maps the source Array into a new Set parameterized by
destinationType. |
<S,D> D |
newObject(S source,
Type<? extends D> destinationClass,
MappingContext context)
Create new instance of a destination class.
|
<S,D> MappingStrategy |
resolveMappingStrategy(S sourceObject,
Type rawAType,
Type rawBType,
boolean mapInPlace,
MappingContext context) |
public ConfigurableMapper()
public ConfigurableMapper(boolean autoInit)
protected void init()
protected void configure(MapperFactory factory)
factory - the MapperFactory instance which may be used to register
various configurations, mappings, etc.protected void configureFactoryBuilder(DefaultMapperFactory.Builder factoryBuilder)
factoryBuilder - the builder which will be used to obtain a MapperFactory
instancepublic <S,D> D map(S sourceObject,
Class<D> destinationClass)
map in interface MapperFacadesourceObject - the object to map fromdestinationClass - the type of the new object to returnsourceObjectpublic <S,D> D map(S sourceObject,
Class<D> destinationClass,
MappingContext context)
MapperFacadesourceObject.map in interface MapperFacadesourceObject - the object to map fromdestinationClass - the type of the new object to returncontext - the context from the current mapping requestsourceObjectpublic <S,D> void map(S sourceObject,
D destinationObject)
MapperFacadesourceObject onto
destinationObject.map in interface MapperFacadesourceObject - the object from which to read the propertiesdestinationObject - the object onto which the properties should be mappedpublic <S,D> void map(S sourceObject,
D destinationObject,
MappingContext context)
MapperFacadesourceObject onto
destinationObject.map in interface MapperFacadesourceObject - the object from which to read the propertiesdestinationObject - the object onto which the properties should be mappedcontext - the context from the current mapping requestpublic <S,D> void map(S sourceObject,
D destinationObject,
Type<S> sourceType,
Type<D> destinationType)
MapperFacadesourceObject onto
destinationObject, using sourceType and
destinationType to specify the parameterized types of the
source and destination object.map in interface MapperFacadesourceObject - the object from which to read the propertiesdestinationObject - the object onto which the properties should be mappedsourceType - the parameterized type of the source objectdestinationType - the parameterized type of the destination objectpublic <S,D> void map(S sourceObject,
D destinationObject,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
MapperFacadesourceObject onto
destinationObject, using sourceType and
destinationType to specify the parameterized types of the
source and destination object.map in interface MapperFacadesourceObject - the object from which to read the propertiesdestinationObject - the object onto which the properties should be mappedsourceType - the parameterized type of the source objectdestinationType - the parameterized type of the destination objectcontext - the context from the current mapping requestpublic <S,D> Set<D> mapAsSet(Iterable<S> source, Class<D> destinationClass)
MapperFacadedestinationClass.mapAsSet in interface MapperFacadesource - the Iterable from which to mapdestinationClass - the type of elements to be contained in the returned Set.destinationClass mapped from the elements of
source.public <S,D> Set<D> mapAsSet(Iterable<S> source, Class<D> destinationClass, MappingContext context)
MapperFacadedestinationClass.mapAsSet in interface MapperFacadesource - the Iterable from which to mapdestinationClass - the type of elements to be contained in the returned Set.context - the context from the current mapping requestdestinationClass mapped from the elements of
source.public <S,D> Set<D> mapAsSet(S[] source, Class<D> destinationClass)
MapperFacadedestinationClass.mapAsSet in interface MapperFacadesource - the Array from which to mapdestinationClass - the type of elements to be contained in the returned Set.destinationClass mapped from the elements of
source.public <S,D> Set<D> mapAsSet(S[] source, Class<D> destinationClass, MappingContext context)
MapperFacadedestinationClass.mapAsSet in interface MapperFacadesource - the Array from which to mapdestinationClass - the type of elements to be contained in the returned Set.context - the context from the current mapping requestdestinationClass mapped from the elements of
source.public <S,D> List<D> mapAsList(Iterable<S> source, Class<D> destinationClass)
MapperFacadedestinationClass.mapAsList in interface MapperFacadesource - the Iterable from which to mapdestinationClass - the type of elements to be contained in the returned Set.destinationClass mapped from the elements of
source.public <S,D> List<D> mapAsList(Iterable<S> source, Class<D> destinationClass, MappingContext context)
MapperFacadedestinationClass.mapAsList in interface MapperFacadesource - the Iterable from which to mapdestinationClass - the type of elements to be contained in the returned Set.context - the context from the current mapping requestdestinationClass mapped from the elements of
source.public <S,D> List<D> mapAsList(S[] source, Class<D> destinationClass)
MapperFacadedestinationClass.mapAsList in interface MapperFacadesource - the Array from which to mapdestinationClass - the type of elements to be contained in the returned Set.destinationClass mapped from the elements of
source.public <S,D> List<D> mapAsList(S[] source, Class<D> destinationClass, MappingContext context)
MapperFacadedestinationClass.mapAsList in interface MapperFacadesource - the Array from which to mapdestinationClass - the type of elements to be contained in the returned Set.context - the context from the current mapping requestdestinationClass mapped from the elements of
source.public <S,D> D[] mapAsArray(D[] destination,
Iterable<S> source,
Class<D> destinationClass)
MapperFacadeD.mapAsArray in interface MapperFacadesource - the Array from which to mapdestinationClass - the type of elements to be contained in the returned Set.destinationClass mapped from the elements of
source.public <S,D> D[] mapAsArray(D[] destination,
S[] source,
Class<D> destinationClass)
MapperFacadeD.mapAsArray in interface MapperFacadedestination - the destination array which is also returnedsource - the source arraydestinationClass - the destination classdestinationClass mapped from the elements of
source.public <S,D> D[] mapAsArray(D[] destination,
Iterable<S> source,
Class<D> destinationClass,
MappingContext context)
MapperFacadeD.mapAsArray in interface MapperFacadedestination - the destination array which is also returnedsource - the source IterabledestinationClass - the destination classcontext - the current MappingContextdestinationClass mapped from the elements of
source.public <S,D> D[] mapAsArray(D[] destination,
S[] source,
Class<D> destinationClass,
MappingContext context)
MapperFacadeD.mapAsArray in interface MapperFacadedestination - the destination array which is also returnedsource - the source ArraydestinationClass - the destination classcontext - the current MappingContextdestinationClass mapped from the elements of
source.public <S,D> D map(S sourceObject,
Type<S> sourceType,
Type<D> destinationType)
MapperFacadesourceObject.map in interface MapperFacadesourceObject - the object to map fromsourceType - the type of the source objectdestinationType - the type of the new object to returnsourceObjectpublic <S,D> D map(S sourceObject,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
MapperFacadesourceObject.map in interface MapperFacadesourceObject - the object to map fromsourceType - the type of the source objectdestinationType - the type of the new object to returncontext - the current mapping contextsourceObjectpublic <S,D> Set<D> mapAsSet(Iterable<S> source, Type<S> sourceType, Type<D> destinationType)
MapperFacadedestinationType.mapAsSet in interface MapperFacadesource - the Iterable from which to mapsourceType - the type of the source elementsdestinationType - the type of the new object to returndestinationType mapped from the elements of
source.public <S,D> Set<D> mapAsSet(Iterable<S> source, Type<S> sourceType, Type<D> destinationType, MappingContext context)
MapperFacadedestinationType.mapAsSet in interface MapperFacadesource - the Iterable from which to mapsourceType - the type of the source elementsdestinationType - the type of the new object to returncontext - the current mapping contextdestinationType mapped from the elements of
source.public <S,D> Set<D> mapAsSet(S[] source, Type<S> sourceType, Type<D> destinationType)
MapperFacadedestinationType.mapAsSet in interface MapperFacadesource - the Array from which to mapsourceType - the type of the source elementsdestinationType - the type of the new object to returndestinationType mapped from the elements of
source.public <S,D> Set<D> mapAsSet(S[] source, Type<S> sourceType, Type<D> destinationType, MappingContext context)
MapperFacadedestinationType.mapAsSet in interface MapperFacadesource - the Array from which to mapsourceType - the type of the source elementsdestinationType - the type of the new object to returncontext - the current mapping contextdestinationType mapped from the elements of
source.public <S,D> List<D> mapAsList(Iterable<S> source, Type<S> sourceType, Type<D> destinationType)
MapperFacadedestinationType.mapAsList in interface MapperFacadesource - the Iterable from which to mapsourceType - the type of the source elementsdestinationType - the type of the new object to return
the current mapping contextdestinationType mapped from the elements of
source.public <S,D> List<D> mapAsList(Iterable<S> source, Type<S> sourceType, Type<D> destinationType, MappingContext context)
MapperFacadedestinationType.mapAsList in interface MapperFacadesource - the Iterable from which to mapsourceType - the type of the source elementsdestinationType - the type of the new object to returncontext - the current mapping contextdestinationType mapped from the elements of
source.public <S,D> List<D> mapAsList(S[] source, Type<S> sourceType, Type<D> destinationType)
MapperFacadedestinationType.mapAsList in interface MapperFacadesource - the Array from which to mapsourceType - the type of the source elementsdestinationType - the type of the new object to returndestinationType mapped from the elements of
source.public <S,D> List<D> mapAsList(S[] source, Type<S> sourceType, Type<D> destinationType, MappingContext context)
MapperFacadedestinationType.mapAsList in interface MapperFacadesource - the Array from which to mapsourceType - the type of the source elementsdestinationType - the type of the new object to returncontext - the current mapping contextdestinationType mapped from the elements of
source.public <S,D> D[] mapAsArray(D[] destination,
Iterable<S> source,
Type<S> sourceType,
Type<D> destinationType)
MapperFacadedestinationType.mapAsArray in interface MapperFacadedestination - the destination Array which is returnedsource - the Array from which to mapsourceType - the type of the source elementsdestinationType - the type of the new object to returnsource.public <S,D> D[] mapAsArray(D[] destination,
S[] source,
Type<S> sourceType,
Type<D> destinationType)
MapperFacadedestinationType.mapAsArray in interface MapperFacadedestination - the destination Array which is returnedsource - the Array from which to mapsourceType - the type of the source elementsdestinationType - the type of the new object to return
the current mapping contextsource.public <S,D> D[] mapAsArray(D[] destination,
Iterable<S> source,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
MapperFacademapAsArray in interface MapperFacadedestination - the destination Array which is returnedsource - the Iterable from which to mapsourceType - the type of the source elementsdestinationType - the type of the new object to returncontext - the current mapping contextsource.public <S,D> D[] mapAsArray(D[] destination,
S[] source,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
MapperFacademapAsArray in interface MapperFacadedestination - the destination Array which is returnedsource - the Array from which to mapsourceType - the type of the source elementsdestinationType - the type of the new object to returncontext - the current mapping contextsource.public <S,D> void mapAsCollection(Iterable<S> source, Collection<D> destination, Class<D> destinationClass)
MapperFacademapAsCollection in interface MapperFacadesource - the source Iterabledestination - the destination CollectiondestinationClass - the destination classpublic <S,D> void mapAsCollection(Iterable<S> source, Collection<D> destination, Class<D> destinationClass, MappingContext context)
MapperFacademapAsCollection in interface MapperFacadesource - the source iterabledestination - the destination collectiondestinationClass - the type of elements in the destinationcontext - the current mapping contextpublic <S,D> void mapAsCollection(S[] source,
Collection<D> destination,
Class<D> destinationCollection)
MapperFacademapAsCollection in interface MapperFacadesource - the source arraydestination - the destination collectiondestinationCollection - the type of elements in the destinationpublic <S,D> void mapAsCollection(S[] source,
Collection<D> destination,
Class<D> destinationCollection,
MappingContext context)
MapperFacademapAsCollection in interface MapperFacadesource - the source arraydestination - the destination collectiondestinationCollection - the type of elements in the destinationcontext - the current mapping contextpublic <S,D> void mapAsCollection(Iterable<S> source, Collection<D> destination, Type<S> sourceType, Type<D> destinationType)
MapperFacademapAsCollection in interface MapperFacadesource - the source iterabledestination - the destination collectionsourceType - the type of elements in the sourcedestinationType - the type of elements in the destinationpublic <S,D> void mapAsCollection(S[] source,
Collection<D> destination,
Type<S> sourceType,
Type<D> destinationType)
MapperFacademapAsCollection in interface MapperFacadesource - the source arraydestination - the destination collectionsourceType - the type of elements in the sourcedestinationType - the type of elements in the destinationpublic <S,D> void mapAsCollection(Iterable<S> source, Collection<D> destination, Type<S> sourceType, Type<D> destinationType, MappingContext context)
MapperFacademapAsCollection in interface MapperFacadesource - the source iterabledestination - the destination collectionsourceType - the type of elements in the sourcedestinationType - the type of elements in the destinationcontext - the current mapping contextpublic <S,D> void mapAsCollection(S[] source,
Collection<D> destination,
Type<S> sourceType,
Type<D> destinationType,
MappingContext context)
MapperFacademapAsCollection in interface MapperFacadesource - the source arraydestination - the destination collectionsourceType - the type of elements in the sourcedestinationType - the type of elements in the destinationcontext - the current mapping contextpublic <S,D> D convert(S source,
Type<S> sourceType,
Type<D> destinationType,
String converterId,
MappingContext context)
MapperFacadeconvert in interface MapperFacadesource - the source object to mapsourceType - the type of the source objectdestinationType - the type of the destination object to produceconverterId - the specific converter to use; if null, the first compatible
global converter is usedpublic <S,D> D convert(S source,
Class<D> destinationClass,
String converterId,
MappingContext context)
MapperFacadeconvert in interface MapperFacadesource - the source object to mapdestinationClass - the type of the destination class to produceconverterId - the specific converter to use; if null, the first compatible
global converter is usedpublic <S,D> D newObject(S source,
Type<? extends D> destinationClass,
MappingContext context)
MapperFacadenewObject in interface MapperFacadesource - the source objetdestinationClass - the type of the destinationcontext - the current mapping contextdestinationClasspublic <Sk,Sv,Dk,Dv> Map<Dk,Dv> mapAsMap(Map<Sk,Sv> source, Type<? extends Map<Sk,Sv>> sourceType, Type<? extends Map<Dk,Dv>> destinationType)
MapperFacademapAsMap in interface MapperFacadesource - the source MapsourceType - the parameterized type of the source Map objectdestinationType - the parameterized type of the destination Map objectpublic <Sk,Sv,Dk,Dv> Map<Dk,Dv> mapAsMap(Map<Sk,Sv> source, Type<? extends Map<Sk,Sv>> sourceType, Type<? extends Map<Dk,Dv>> destinationType, MappingContext context)
MapperFacademapAsMap in interface MapperFacadecontext - context the context from the current mapping requestpublic <S,Dk,Dv> Map<Dk,Dv> mapAsMap(Iterable<S> source, Type<S> sourceType, Type<? extends Map<Dk,Dv>> destinationType)
MapperFacademapAsMap in interface MapperFacadesource - the source MapsourceType - the parameterized type of the source Map objectdestinationType - the parameterized type of the destination Map objectpublic <S,Dk,Dv> Map<Dk,Dv> mapAsMap(Iterable<S> source, Type<S> sourceType, Type<? extends Map<Dk,Dv>> destinationType, MappingContext context)
MapperFacademapAsMap in interface MapperFacadesource - the source MapsourceType - the parameterized type of the source Map objectdestinationType - the parameterized type of the destination Map objectcontext - the current mapping contextpublic <S,Dk,Dv> Map<Dk,Dv> mapAsMap(S[] source, Type<S> sourceType, Type<? extends Map<Dk,Dv>> destinationType)
MapperFacademapAsMap in interface MapperFacadesource - the source ArraysourceType - the parameterized type of the source Map objectdestinationType - the parameterized type of the destination Map objectpublic <S,Dk,Dv> Map<Dk,Dv> mapAsMap(S[] source, Type<S> sourceType, Type<? extends Map<Dk,Dv>> destinationType, MappingContext context)
MapperFacademapAsMap in interface MapperFacadesource - the source ArraysourceType - the parameterized type of the source Array elementdestinationType - the parameterized type of the destination Map objectcontext - the current mapping contextpublic <Sk,Sv,D> List<D> mapAsList(Map<Sk,Sv> source, Type<? extends Map<Sk,Sv>> sourceType, Type<D> destinationType)
MapperFacademapAsList in interface MapperFacadesource - the source MapsourceType - the parameterized type of the source Map objectdestinationType - the parameterized type of the destination List elementspublic <Sk,Sv,D> List<D> mapAsList(Map<Sk,Sv> source, Type<? extends Map<Sk,Sv>> sourceType, Type<D> destinationType, MappingContext context)
MapperFacademapAsList in interface MapperFacadesource - the source MapsourceType - the parameterized type of the source Map objectdestinationType - the parameterized type of the destination List elementscontext - the current mapping contextpublic <Sk,Sv,D> Set<D> mapAsSet(Map<Sk,Sv> source, Type<? extends Map<Sk,Sv>> sourceType, Type<D> destinationType)
MapperFacademapAsSet in interface MapperFacadesource - the source MapsourceType - the parameterized type of the source Map objectdestinationType - the parameterized type of the destination Set elementspublic <Sk,Sv,D> Set<D> mapAsSet(Map<Sk,Sv> source, Type<? extends Map<Sk,Sv>> sourceType, Type<D> destinationType, MappingContext context)
MapperFacademapAsSet in interface MapperFacadesource - the source MapsourceType - the parameterized type of the source Map objectdestinationType - the parameterized type of the destination Set elementscontext - the current mapping contextpublic <Sk,Sv,D> D[] mapAsArray(D[] destination,
Map<Sk,Sv> source,
Type<? extends Map<Sk,Sv>> sourceType,
Type<D> destinationType)
MapperFacademapAsArray in interface MapperFacadedestination - the destination Array which is also returnedsource - the source MapsourceType - the parameterized type of the source Map objectdestinationType - the parameterized type of the destination Array elementspublic <Sk,Sv,D> D[] mapAsArray(D[] destination,
Map<Sk,Sv> source,
Type<? extends Map<Sk,Sv>> sourceType,
Type<D> destinationType,
MappingContext context)
MapperFacademapAsArray in interface MapperFacadedestination - the destination Array which is also returnedsource - the source MapsourceType - the parameterized type of the source Map objectdestinationType - the parameterized type of the destination Array elementscontext - the current mapping contextpublic <S,D> MappingStrategy resolveMappingStrategy(S sourceObject, Type rawAType, Type rawBType, boolean mapInPlace, MappingContext context)
resolveMappingStrategy in interface MapperFacadesourceObject - the source object being mappedrawAType - the source type to maprawBType - the destination typemapInPlace - whether the strategy should map objects in-placecontext - the current MappingContextpublic <S,D> BoundMapperFacade<S,D> dedicatedMapperFor(Type<S> sourceType, Type<D> destinationType)
public <S,D> BoundMapperFacade<S,D> dedicatedMapperFor(Type<S> sourceType, Type<D> destinationType, boolean containsCycles)
public <A,B> BoundMapperFacade<A,B> dedicatedMapperFor(Class<A> aType, Class<B> bType)
public <A,B> BoundMapperFacade<A,B> dedicatedMapperFor(Class<A> aType, Class<B> bType, boolean containsCycles)
public void factoryModified(MapperFactory factory)
MapperFacadefactoryModified in interface MapperFacadeCopyright © 2019 Glasnost. All rights reserved.