Class BaseAttributeStrategyConverterProvider<T>
java.lang.Object
de.hybris.platform.cms2.cmsitems.converter.impl.BaseAttributeStrategyConverterProvider<T>
- Type Parameters:
T- type parameter. The type is used as a type for getContentConverter attribute as well as a type forAttributeStrategyConverterProviderandAttributeContentConverter.
- All Implemented Interfaces:
AttributeStrategyConverterProvider<T>,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
DefaultAttributeStrategyConverterProvider,VersionAttributeToDataStrategyConverterProvider,VersionDataToAttributeStrategyConverterProvider
public class BaseAttributeStrategyConverterProvider<T>
extends Object
implements AttributeStrategyConverterProvider<T>, org.springframework.beans.factory.InitializingBean
Base and generic implementation of the
AttributeStrategyConverterProvider<T> interface for Attribute Strategy Conversions.
It depends on a default value converter and a AttributeContentConverter<T> list that maps
Predicate<T> to Converter<Object, Object>.
The logic requires that the content converters should be an instance of LinkedList because the Predicates
will be tested in the descending order, and the first one that is accepted will be returned.
Returns null if no matching AttributeContentConverter<T>.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected List<AttributeContentConverter<T>>getContentConverter(T attributeDescriptor) Will return the most appropriateAttributeContentConverterto convert back and forth between a property value and a serializable representationprotected com.google.common.base.Supplier<Stream<AttributeContentConverter<T>>>A Supplier for a descending stream of the entries from the content converter list.protected Deque<AttributeContentConverter<T>>voidsetAttributeContentConverters(List<AttributeContentConverter<T>> attributeContentConverters)
-
Constructor Details
-
BaseAttributeStrategyConverterProvider
public BaseAttributeStrategyConverterProvider()
-
-
Method Details
-
getContentConverter
Description copied from interface:AttributeStrategyConverterProviderWill return the most appropriateAttributeContentConverterto convert back and forth between a property value and a serializable representation- Specified by:
getContentConverterin interfaceAttributeStrategyConverterProvider<T>- Parameters:
attributeDescriptor- the parameter holding the metadata of a property- Returns:
- the content converter destined to a given source.
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getDescendingConverterStreamSupplier
protected com.google.common.base.Supplier<Stream<AttributeContentConverter<T>>> getDescendingConverterStreamSupplier()A Supplier for a descending stream of the entries from the content converter list.- Returns:
- a supplier that provides a stream of converters in descending order.
-
getInternalAttributeContentConverters
-
getAttributeContentConverters
-
setAttributeContentConverters
public void setAttributeContentConverters(List<AttributeContentConverter<T>> attributeContentConverters)
-