public class DefaultDataMapper extends ConfigurableMapper implements DataMapper
DataMapper used for mapping commercefacade's
Data objects into WsDTOs. ma.glasnost.orika.Mapper,
ma.glasnost.orika.Converter or ma.glasnost.orika.Filter annotated with
WsDTOMapping.FIELD_PREFIX, FIELD_SET_NAME, MAP_NULLS| Constructor and Description |
|---|
DefaultDataMapper() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAllSpringBeans()
Registers all managed beans of type
ma.glasnost.orika.Mapper, ma.glasnost.orika.Converter or
ma.glasnost.orika.Filter and annotated with
WsDTOMapping. |
void |
addConverter(<any> converter)
Registers a
ma.glasnost.orika.Converter. |
void |
addFieldMapper(FieldMapper fieldMapper)
Registers a
ma.glasnost.orika.metadata.ClassMap with field mapping given by fieldMapper object |
void |
addFilter(<any> filter)
Registers a
ma.glasnost.orika.Filter. |
void |
addMapper(<any> mapper)
Registers a
ma.glasnost.orika.Mapper. |
protected void |
configure(MapperFactory factory) |
protected void |
configureFactoryBuilder(DefaultMapperFactory.Builder factoryBuilder) |
protected MappingContext |
createMappingContext(java.lang.Class destinationClass,
java.lang.String fields) |
protected MappingContext |
createMappingContext(java.lang.Class destinationClass,
java.lang.String fields,
boolean mapNulls) |
protected MappingContext |
createMappingContext(java.util.Set<java.lang.String> fields) |
protected MappingContext |
createMappingContextForGeneric(java.lang.Class destinationClass,
java.lang.String fields,
java.util.Map<java.lang.String,java.lang.Class> typeVariableMap) |
protected java.util.Collection<java.lang.Object> |
getBeansForConfiguration()
Finds all beans with annotation WsDTOMapping in current context and in parent contexts
|
<S,D> D |
map(S sourceObject,
java.lang.Class<D> destinationClass,
java.util.Set<java.lang.String> fields)
Create and return a new instance of type D mapped with the specified
fields of
sourceObject. |
<S,D> D |
map(S sourceObject,
java.lang.Class<D> destinationClass,
java.lang.String fields)
Create and return a new instance of type D mapped with the specified
fields of
sourceObject. |
<S,D> void |
map(S sourceObject,
D destinationObject,
boolean mapNulls)
Maps the properties of
sourceObject onto destinationObject. |
<S,D> void |
map(S sourceObject,
D destinationObject,
java.lang.String fields)
Maps the properties of
sourceObject onto destinationObject. |
<S,D> void |
map(S sourceObject,
D destinationObject,
java.lang.String fields,
boolean mapNulls)
Maps the properties of
sourceObject onto destinationObject. |
<S,D> void |
mapAsCollection(java.lang.Iterable<S> source,
java.util.Collection<D> destination,
java.lang.Class<D> destinationClass,
java.lang.String fields)
Map an iterable onto an existing collection
|
<S,D> java.util.List<D> |
mapAsList(java.lang.Iterable<S> source,
java.lang.Class<D> destinationClass,
java.lang.String fields)
Maps the source Iterable into a new List parameterized by
destinationClass. |
<S,D> java.util.Set<D> |
mapAsSet(java.lang.Iterable<S> source,
java.lang.Class<D> destinationClass,
java.lang.String fields)
Maps the source iterable into a new Set parameterized by
destinationClass. |
<S,D> void |
mapGeneric(S sourceObject,
D destObject,
java.lang.reflect.Type[] sourceActualTypeArguments,
java.lang.reflect.Type[] destActualTypeArguments,
java.lang.String fields,
java.util.Map<java.lang.String,java.lang.Class> destTypeVariableMap)
Maps the properties of
sourceObject onto destinationObject, using
sourceActualTypeArguments and destActualTypeArguments to specify the arguments of
parameterized types of the source and destination object. |
protected void |
registerObjectFactory(TypeObjectFactory<java.lang.Object> objectFactory) |
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setFieldSetBuilder(FieldSetBuilder fieldSetBuilder) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmap, mapprotected void configureFactoryBuilder(DefaultMapperFactory.Builder factoryBuilder)
protected void configure(MapperFactory factory)
public void setApplicationContext(ApplicationContext applicationContext)
protected void addAllSpringBeans()
ma.glasnost.orika.Mapper, ma.glasnost.orika.Converter or
ma.glasnost.orika.Filter and annotated with
WsDTOMapping.protected java.util.Collection<java.lang.Object> getBeansForConfiguration()
protected void registerObjectFactory(TypeObjectFactory<java.lang.Object> objectFactory)
public void addConverter(<any> converter)
ma.glasnost.orika.Converter.converter - The converter.public void addMapper(<any> mapper)
ma.glasnost.orika.Mapper.mapper - The mapper.public void addFilter(<any> filter)
ma.glasnost.orika.Filter.filter - The filter.public void addFieldMapper(FieldMapper fieldMapper)
ma.glasnost.orika.metadata.ClassMap with field mapping given by fieldMapper objectfieldMapper - Object storing field mapping information.public <S,D> D map(S sourceObject,
java.lang.Class<D> destinationClass,
java.lang.String fields)
DataMapperfields of
sourceObject.map in interface DataMappersourceObject - the object to map fromdestinationClass - the type of the new object to returnfields - comma-separated fields to mapfields of sourceObjectpublic <S,D> D map(S sourceObject,
java.lang.Class<D> destinationClass,
java.util.Set<java.lang.String> fields)
DataMapperfields of
sourceObject.map in interface DataMappersourceObject - the object to map fromdestinationClass - the type of the new object to returnfields - set of fully qualified field names to mapfields of sourceObjectpublic <S,D> void map(S sourceObject,
D destinationObject,
java.lang.String fields)
DataMappersourceObject onto destinationObject.map in interface DataMappersourceObject - the object from which to read the propertiesdestinationObject - the object onto which the properties should be mappedfields - comma-separated fields to mappublic <S,D> void map(S sourceObject,
D destinationObject,
java.lang.String fields,
boolean mapNulls)
DataMappersourceObject onto destinationObject.map in interface DataMappersourceObject - the object from which to read the propertiesdestinationObject - the object onto which the properties should be mappedfields - comma-separated fields to mapmapNulls - controls whether nulls are mapped or ignoredpublic <S,D> void map(S sourceObject,
D destinationObject,
boolean mapNulls)
DataMappersourceObject onto destinationObject.map in interface DataMappersourceObject - the object from which to read the propertiesdestinationObject - the object onto which the properties should be mappedmapNulls - controls whether nulls are mapped or ignoredpublic <S,D> java.util.List<D> mapAsList(java.lang.Iterable<S> source,
java.lang.Class<D> destinationClass,
java.lang.String fields)
DataMapperdestinationClass.mapAsList in interface DataMappersource - the Iterable from which to mapdestinationClass - the type of elements to be contained in the returned Set.fields - comma-separated fields to mapdestinationClass mapped from the elements of
source.public <S,D> java.util.Set<D> mapAsSet(java.lang.Iterable<S> source,
java.lang.Class<D> destinationClass,
java.lang.String fields)
DataMapperdestinationClass.mapAsSet in interface DataMappersource - the Iterable from which to mapdestinationClass - the type of elements to be contained in the returned Set.fields - comma-separated fields to mapdestinationClass mapped from the elements of
source.public <S,D> void mapAsCollection(java.lang.Iterable<S> source,
java.util.Collection<D> destination,
java.lang.Class<D> destinationClass,
java.lang.String fields)
DataMappermapAsCollection in interface DataMappersource - the source iterabledestination - the destination collectiondestinationClass - the type of elements in the destinationfields - comma-separated fields to mappublic <S,D> void mapGeneric(S sourceObject,
D destObject,
java.lang.reflect.Type[] sourceActualTypeArguments,
java.lang.reflect.Type[] destActualTypeArguments,
java.lang.String fields,
java.util.Map<java.lang.String,java.lang.Class> destTypeVariableMap)
DataMappersourceObject onto destinationObject, using
sourceActualTypeArguments and destActualTypeArguments to specify the arguments of
parameterized types of the source and destination object.mapGeneric in interface DataMappersourceObject - the object from which to read the propertiesdestObject - the object onto which the properties should be mappedsourceActualTypeArguments - arguments of source typedestActualTypeArguments - arguments of dest typefields - comma-separated fields to mapdestTypeVariableMap - - map containing information about types used in generic class protected MappingContext createMappingContext(java.util.Set<java.lang.String> fields)
protected MappingContext createMappingContext(java.lang.Class destinationClass,
java.lang.String fields)
protected MappingContext createMappingContext(java.lang.Class destinationClass,
java.lang.String fields,
boolean mapNulls)
protected MappingContext createMappingContextForGeneric(java.lang.Class destinationClass,
java.lang.String fields,
java.util.Map<java.lang.String,java.lang.Class> typeVariableMap)
public void setFieldSetBuilder(FieldSetBuilder fieldSetBuilder)
Copyright © 2018 SAP SE. All Rights Reserved.