Class AbstractDataToWsConverter<DATA,WSDTO>
java.lang.Object
de.hybris.platform.cmsoccaddon.mapping.converters.AbstractDataToWsConverter<DATA,WSDTO>
- Type Parameters:
DATA- the source object to convertWSDTO- the target object to populate
- All Implemented Interfaces:
DataToWsConverter<DATA,WSDTO>
- Direct Known Subclasses:
ComponentDataToWsConverter,MediaDataToWsConverter,NavigationNodeDataToWsConverter,PageDataToWsConverter,SlotDataToWsConverter
public abstract class AbstractDataToWsConverter<DATA,WSDTO>
extends Object
implements DataToWsConverter<DATA,WSDTO>
The abstract implementation of
DataToWsConverter that uses CMSDataMapper to convert data objects to
ws objects.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPredicate to verify whether the convert method can be used or not.Method to convert a source object to a target object.convertCollection(Collection<Object> source) Converts collection that contains data objects to a collection that contains ws objects.convertMap(Map<String, Object> map) Convert a map that contains data objects to a map that contains ws objects.convertPrimitive(Object source) Converts primitives from source to targetvoidcustomize(ma.glasnost.orika.MapperFactory factory) Method to customize conversion between source and target object.protected CMSDataMapperprotected static booleanisCollection(Object valueObj) Method tests whether theObjectis aCollection.protected static booleanvoidsetMapper(CMSDataMapper mapper) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.cmsoccaddon.mapping.converters.DataToWsConverter
getDataClass, getWsClass
-
Field Details
-
fields
-
-
Constructor Details
-
AbstractDataToWsConverter
public AbstractDataToWsConverter()
-
-
Method Details
-
canConvert
Description copied from interface:DataToWsConverterPredicate to verify whether the convert method can be used or not.- Specified by:
canConvertin interfaceDataToWsConverter<DATA,WSDTO> - Returns:
TRUEwhen {DataToWsConverter.convert(Object, String)can be performed;FALSEotherwise.
-
convert
Description copied from interface:DataToWsConverterMethod to convert a source object to a target object.- Specified by:
convertin interfaceDataToWsConverter<DATA,WSDTO> - Parameters:
source- the source objectfields- the fields that should be populated in target object- Returns:
- the target object
-
convertMap
Convert a map that contains data objects to a map that contains ws objects.- Parameters:
map- the map that contains data objects- Returns:
- the map that contains ws objects.
-
convertPrimitive
Converts primitives from source to target- Parameters:
source- the source primitive- Returns:
- the target primitive
-
convertCollection
Converts collection that contains data objects to a collection that contains ws objects.- Parameters:
source- the collection that contains data objects- Returns:
- the collection that contains ws objects.
-
customize
public void customize(ma.glasnost.orika.MapperFactory factory) Description copied from interface:DataToWsConverterMethod to customize conversion between source and target object. This method is called after the basic conversion is finished.- Specified by:
customizein interfaceDataToWsConverter<DATA,WSDTO> - Parameters:
factory- theMapperFactorythat can be used to add new customization.
-
isCollection
Method tests whether theObjectis aCollection.- Parameters:
valueObj- theObjectto test- Returns:
- true if the
Objectis aCollection, false otherwise.
-
isMap
-
getMapper
-
setMapper
-