Class AbstractContextualPopulatingConverter<SOURCE,TARGET,CONTEXT>
- java.lang.Object
-
- de.hybris.platform.converters.impl.AbstractConverter<SOURCE,TARGET>
-
- de.hybris.platform.converters.impl.AbstractPopulatingConverter<SOURCE,TARGET>
-
- de.hybris.platform.sap.productconfig.runtime.interf.impl.AbstractContextualPopulatingConverter<SOURCE,TARGET,CONTEXT>
-
- Type Parameters:
SOURCE- type of source objectTARGET- type of target objectCONTEXT- type of populating context
- All Implemented Interfaces:
Populator<SOURCE,TARGET>,PopulatorList<SOURCE,TARGET>,ContextualConverter<SOURCE,TARGET,CONTEXT>,ContextualPopulaterList<SOURCE,TARGET,CONTEXT>,Converter<SOURCE,TARGET>,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean,org.springframework.core.convert.converter.Converter<SOURCE,TARGET>
public class AbstractContextualPopulatingConverter<SOURCE,TARGET,CONTEXT> extends AbstractPopulatingConverter<SOURCE,TARGET> implements ContextualPopulaterList<SOURCE,TARGET,CONTEXT>, ContextualConverter<SOURCE,TARGET,CONTEXT>
Compared to it's parent theAbstractPopulatingConverter, this abstract converter can handle both ordinaryPopulators andContextualPopulators.
So it manages two lists. ThePopulatorListcontains ordinaryPopulators, which are called without a context during the convert process, while theContextualPopulaterListcontainsContextualPopulators, which are called with a context during the convert process.
-
-
Constructor Summary
Constructors Constructor Description AbstractContextualPopulatingConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TARGETconvertWithContext(SOURCE source, CONTEXT context)Converts the source object, creating a new instance of the destination typejava.util.List<ContextualPopulator<SOURCE,TARGET,CONTEXT>>getContextualPopulators()Get the list of populators.voidpopulate(SOURCE source, TARGET target, CONTEXT context)Populate the target instance from the source instance.voidremovePopulatorsDuplicates()voidsetContextualPopulators(java.util.List<ContextualPopulator<SOURCE,TARGET,CONTEXT>> contextualPopulators)Set the list of populators.-
Methods inherited from class de.hybris.platform.converters.impl.AbstractPopulatingConverter
getPopulators, populate, setPopulators
-
Methods inherited from class de.hybris.platform.converters.impl.AbstractConverter
afterPropertiesSet, convert, convert, createFromClass, createTarget, getMyBeanName, setBeanName, setTargetClass
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.servicelayer.dto.converter.Converter
convert, convert, convertAll, convertAllIgnoreExceptions, getLogger
-
-
-
-
Method Detail
-
getContextualPopulators
public java.util.List<ContextualPopulator<SOURCE,TARGET,CONTEXT>> getContextualPopulators()
Description copied from interface:ContextualPopulaterListGet the list of populators.- Specified by:
getContextualPopulatorsin interfaceContextualPopulaterList<SOURCE,TARGET,CONTEXT>- Returns:
- the populators.
-
setContextualPopulators
public void setContextualPopulators(java.util.List<ContextualPopulator<SOURCE,TARGET,CONTEXT>> contextualPopulators)
Description copied from interface:ContextualPopulaterListSet the list of populators.- Specified by:
setContextualPopulatorsin interfaceContextualPopulaterList<SOURCE,TARGET,CONTEXT>- Parameters:
contextualPopulators- the populators
-
populate
public void populate(SOURCE source, TARGET target, CONTEXT context)
Populate the target instance from the source instance. Calls a list of injected populators to populate the instance.- Parameters:
source- the source itemtarget- the target item to populatecontext- populating context
-
convertWithContext
public TARGET convertWithContext(SOURCE source, CONTEXT context)
Description copied from interface:ContextualConverterConverts the source object, creating a new instance of the destination type- Specified by:
convertWithContextin interfaceContextualConverter<SOURCE,TARGET,CONTEXT>- Parameters:
source- the source objectcontext- converting context- Returns:
- the converted object
-
removePopulatorsDuplicates
@PostConstruct public void removePopulatorsDuplicates()
- Overrides:
removePopulatorsDuplicatesin classAbstractPopulatingConverter<SOURCE,TARGET>
-
-