Class GenericComposedTypeToStructureConverter
- java.lang.Object
-
- de.hybris.platform.cmsfacades.types.converter.GenericComposedTypeToStructureConverter
-
- All Implemented Interfaces:
Converter<ComposedTypeModel,ComponentTypeStructure>,org.springframework.beans.factory.InitializingBean
public class GenericComposedTypeToStructureConverter extends java.lang.Object implements Converter<ComposedTypeModel,ComponentTypeStructure>, org.springframework.beans.factory.InitializingBean
Converter class fromComposedTypeModeltoComponentTypeStructure.
-
-
Constructor Summary
Constructors Constructor Description GenericComposedTypeToStructureConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected voidcollectAttributes(ComposedTypeModel composedType, java.util.List<ComponentTypeAttributeStructure> attributes)Recursively collects attributes of a given type that is not blacklisted until it reaches the root type (CMSItem).ComponentTypeStructureconvert(ComposedTypeModel source)Uses the sourceSobject and produces an new instance ofT.protected ComponentTypeAttributeStructureconvertAttributeDescriptor(AttributeDescriptorModel attributeDescriptor)Converts an attribute descriptor into an instance ofComponentTypeAttributeStructure.protected AttributePopulatorsProvidergetAttributePopulatorsProvider()protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>>getBlacklistAttributes()protected org.springframework.beans.factory.ObjectFactory<ComponentTypeAttributeStructure>getComponentTypeAttributeStructureObjectFactory()protected org.springframework.beans.factory.ObjectFactory<ComponentTypeStructure>getComponentTypeStructureObjectFactory()java.util.Map<java.lang.String,java.lang.String>getStructureTypeBlacklistAttributeMap()protected java.util.function.Function<ComposedTypeModel,java.lang.Class>getTypeDataClassFunction()voidsetAttributePopulatorsProvider(AttributePopulatorsProvider attributePopulatorsProvider)voidsetBlacklistAttributes(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> blacklistAttributes)voidsetComponentTypeAttributeStructureObjectFactory(org.springframework.beans.factory.ObjectFactory<ComponentTypeAttributeStructure> componentTypeAttributeStructureObjectFactory)voidsetComponentTypeStructureObjectFactory(org.springframework.beans.factory.ObjectFactory<ComponentTypeStructure> componentTypeStructureObjectFactory)voidsetStructureTypeBlacklistAttributeMap(java.util.Map<java.lang.String,java.lang.String> structureTypeBlacklistAttributeMap)voidsetTypeDataClassFunction(java.util.function.Function<ComposedTypeModel,java.lang.Class> typeDataClassFunction)
-
-
-
Method Detail
-
convert
public ComponentTypeStructure convert(ComposedTypeModel source)
Description copied from interface:ConverterUses the sourceSobject and produces an new instance ofT.- Specified by:
convertin interfaceConverter<ComposedTypeModel,ComponentTypeStructure>- Parameters:
source- the input to be converted.- Returns:
- an instance of
T, converted from the input source.
-
collectAttributes
protected void collectAttributes(ComposedTypeModel composedType, java.util.List<ComponentTypeAttributeStructure> attributes)
Recursively collects attributes of a given type that is not blacklisted until it reaches the root type (CMSItem).- Parameters:
composedType- the type which the attributes are collected from.attributes- the attribute list that will be augmented by introspecting thecomposedType.
-
convertAttributeDescriptor
protected ComponentTypeAttributeStructure convertAttributeDescriptor(AttributeDescriptorModel attributeDescriptor)
Converts an attribute descriptor into an instance ofComponentTypeAttributeStructure. Applies registry configuration on top of each attribute as well.- Parameters:
attributeDescriptor- the attribute descriptor to be converted/- Returns:
- instance of ComponentTypeAttributeStructure populated with values from configuration on top of type service and registry.
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
getTypeDataClassFunction
protected java.util.function.Function<ComposedTypeModel,java.lang.Class> getTypeDataClassFunction()
-
setTypeDataClassFunction
public void setTypeDataClassFunction(java.util.function.Function<ComposedTypeModel,java.lang.Class> typeDataClassFunction)
-
getStructureTypeBlacklistAttributeMap
public java.util.Map<java.lang.String,java.lang.String> getStructureTypeBlacklistAttributeMap()
-
setStructureTypeBlacklistAttributeMap
public void setStructureTypeBlacklistAttributeMap(java.util.Map<java.lang.String,java.lang.String> structureTypeBlacklistAttributeMap)
-
getBlacklistAttributes
protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getBlacklistAttributes()
-
setBlacklistAttributes
public void setBlacklistAttributes(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> blacklistAttributes)
-
getAttributePopulatorsProvider
protected AttributePopulatorsProvider getAttributePopulatorsProvider()
-
setAttributePopulatorsProvider
public void setAttributePopulatorsProvider(AttributePopulatorsProvider attributePopulatorsProvider)
-
getComponentTypeAttributeStructureObjectFactory
protected org.springframework.beans.factory.ObjectFactory<ComponentTypeAttributeStructure> getComponentTypeAttributeStructureObjectFactory()
-
setComponentTypeAttributeStructureObjectFactory
public void setComponentTypeAttributeStructureObjectFactory(org.springframework.beans.factory.ObjectFactory<ComponentTypeAttributeStructure> componentTypeAttributeStructureObjectFactory)
-
getComponentTypeStructureObjectFactory
protected org.springframework.beans.factory.ObjectFactory<ComponentTypeStructure> getComponentTypeStructureObjectFactory()
-
setComponentTypeStructureObjectFactory
public void setComponentTypeStructureObjectFactory(org.springframework.beans.factory.ObjectFactory<ComponentTypeStructure> componentTypeStructureObjectFactory)
-
-