Class DefaultComponentTypeStructureRegistry
- java.lang.Object
-
- de.hybris.platform.cmsfacades.types.service.impl.DefaultComponentTypeStructureRegistry
-
- All Implemented Interfaces:
ComponentTypeStructureRegistry,org.springframework.beans.factory.InitializingBean
public class DefaultComponentTypeStructureRegistry extends java.lang.Object implements ComponentTypeStructureRegistry, org.springframework.beans.factory.InitializingBean
Default implementation of theComponentTypeStructureRegistry. This implementation uses autowire-by-type to inject all beans implementingComponentTypeStructureandComponentTypeAttributeStructure.All
ComponentTypeStructureandComponentTypeAttributeStructureelements will be merged into a single set of elements that will represent the single source of truth for the Structure API.
-
-
Constructor Summary
Constructors Constructor Description DefaultComponentTypeStructureRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterPropertiesSet()ComponentTypeStructuregetAbstractComponentTypeStructure(java.lang.String itemType)Deprecated.since 1905, not needed by the generic structure serviceprotected java.util.Set<ComponentTypeAttributeStructure>getAllComponentTypeAttributeStructures()protected java.util.Set<ComponentTypeStructure>getAllComponentTypeStructures()protected java.util.Set<java.lang.String>getCmsSupportedAbstractTypecodes()Deprecated, for removal: This API element is subject to removal in a future version.since 1905, not needed by the generic structure servicejava.util.Optional<ComponentTypeAttributeStructure>getComponentTypeAttributeStructure(java.lang.String typecode, java.lang.String qualifier)Get a specificComponentTypeAttributeStructureby typecode and qualifier.ComponentTypeStructuregetComponentTypeStructure(java.lang.String typecode)Get a specificComponentTypeStructureby its typecode.protected java.util.Map<java.lang.String,ComponentTypeStructure>getComponentTypeStructureMap()java.util.Collection<ComponentTypeStructure>getComponentTypeStructures()Get all elements in the registry.protected FacadeValidationServicegetFacadeValidationService()protected ComponentTypeStructuregetOrCreateComponentTypeStructure(java.lang.String typeCode)Gets or Creates a new Component Type Structure.protected org.springframework.validation.ValidatorgetStructureTypesPostCreationValidator()protected TypeServicegetTypeService()protected booleanmatchesComposedType(java.lang.String abstractTypeCode, java.lang.String itemType)Verifies that the given typecode has the sameComposedTypeas the provided itemtype.protected voidputOrUpdateStructureType(ComponentTypeStructure type)If the map of component type structures is empty, then add this element to the map.voidsetAllComponentTypeAttributeStructures(java.util.Set<ComponentTypeAttributeStructure> allComponentTypeAttributeStructures)voidsetAllComponentTypeStructures(java.util.Set<ComponentTypeStructure> allComponentTypeStructures)voidsetCmsSupportedAbstractTypecodes(java.util.Set<java.lang.String> cmsSupportedAbstractTypecodes)Deprecated, for removal: This API element is subject to removal in a future version.since 1905, not needed by the generic structure servicevoidsetFacadeValidationService(FacadeValidationService facadeValidationService)voidsetStructureTypesPostCreationValidator(org.springframework.validation.Validator structureTypesPostCreationValidator)voidsetTypeService(TypeService typeService)protected voidupdateAttributes(ComponentTypeAttributeStructure attribute)If the component type structure matching the typecode given in the attribute does not have any attributes with the same qualifier as the given attribute, then add the attribute to the collection of attributes of the component type structure.
-
-
-
Method Detail
-
getComponentTypeAttributeStructure
public java.util.Optional<ComponentTypeAttributeStructure> getComponentTypeAttributeStructure(java.lang.String typecode, java.lang.String qualifier)
Description copied from interface:ComponentTypeStructureRegistryGet a specificComponentTypeAttributeStructureby typecode and qualifier.- Specified by:
getComponentTypeAttributeStructurein interfaceComponentTypeStructureRegistry- Parameters:
typecode- - the typecode of the element to retrieve from the registry.qualifier- - the qualifier of the element to retrieve from the registry.- Returns:
- the element matching the typecode and qualifier
-
getComponentTypeStructure
public ComponentTypeStructure getComponentTypeStructure(java.lang.String typecode)
Description copied from interface:ComponentTypeStructureRegistryGet a specificComponentTypeStructureby its typecode.- Specified by:
getComponentTypeStructurein interfaceComponentTypeStructureRegistry- Parameters:
typecode- - the typecode of the element to retrieve from the registry.- Returns:
- the element matching the typecode
-
getAbstractComponentTypeStructure
@Deprecated public ComponentTypeStructure getAbstractComponentTypeStructure(java.lang.String itemType)
Deprecated.since 1905, not needed by the generic structure serviceGet a specificComponentTypeStructureof an Abstract type by its itemtype.- Specified by:
getAbstractComponentTypeStructurein interfaceComponentTypeStructureRegistry- Parameters:
itemType- - the itemtype of the element to retrieve from the registry.- Returns:
- the element matching the itemtype
-
matchesComposedType
protected boolean matchesComposedType(java.lang.String abstractTypeCode, java.lang.String itemType)Verifies that the given typecode has the sameComposedTypeas the provided itemtype.- Parameters:
abstractTypeCode- - the typecode whichComposedTypewill be compareditemType- - the itemtype used for comparison- Returns:
- TRUE if the
ComposedTypeof the given typecode matches the itemtype specified; FALSE otherwise
-
getComponentTypeStructures
public java.util.Collection<ComponentTypeStructure> getComponentTypeStructures()
Description copied from interface:ComponentTypeStructureRegistryGet all elements in the registry.- Specified by:
getComponentTypeStructuresin interfaceComponentTypeStructureRegistry- Returns:
- all items in the registry or an empty collection if no elements are found.
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
putOrUpdateStructureType
protected void putOrUpdateStructureType(ComponentTypeStructure type)
If the map of component type structures is empty, then add this element to the map. Otherwise, update the set of populators for the element found in the map by adding the populators from the given element.- Parameters:
type- - the component type structure to process
-
updateAttributes
protected void updateAttributes(ComponentTypeAttributeStructure attribute) throws java.lang.IllegalArgumentException
If the component type structure matching the typecode given in the attribute does not have any attributes with the same qualifier as the given attribute, then add the attribute to the collection of attributes of the component type structure. Otherwise, if there is an attribute with the same qualifier already in the collection of attributes, then we add the populators of the given attribute to that attribute.- Parameters:
attribute- - the attribute to process- Throws:
java.lang.IllegalArgumentException- when the typecode provided in the attributes does not match any component type structure in the map.
-
getOrCreateComponentTypeStructure
protected ComponentTypeStructure getOrCreateComponentTypeStructure(java.lang.String typeCode)
Gets or Creates a new Component Type Structure.- Parameters:
typeCode- the type code used to get the- Returns:
- the
ComponentTypeStructureinstance.
-
getComponentTypeStructureMap
protected java.util.Map<java.lang.String,ComponentTypeStructure> getComponentTypeStructureMap()
-
getAllComponentTypeStructures
protected java.util.Set<ComponentTypeStructure> getAllComponentTypeStructures()
-
setAllComponentTypeStructures
public void setAllComponentTypeStructures(java.util.Set<ComponentTypeStructure> allComponentTypeStructures)
-
getAllComponentTypeAttributeStructures
protected java.util.Set<ComponentTypeAttributeStructure> getAllComponentTypeAttributeStructures()
-
setAllComponentTypeAttributeStructures
public void setAllComponentTypeAttributeStructures(java.util.Set<ComponentTypeAttributeStructure> allComponentTypeAttributeStructures)
-
getFacadeValidationService
protected FacadeValidationService getFacadeValidationService()
-
setFacadeValidationService
public void setFacadeValidationService(FacadeValidationService facadeValidationService)
-
getStructureTypesPostCreationValidator
protected org.springframework.validation.Validator getStructureTypesPostCreationValidator()
-
setStructureTypesPostCreationValidator
public void setStructureTypesPostCreationValidator(org.springframework.validation.Validator structureTypesPostCreationValidator)
-
getCmsSupportedAbstractTypecodes
@Deprecated(since="1905", forRemoval=true) protected java.util.Set<java.lang.String> getCmsSupportedAbstractTypecodes()Deprecated, for removal: This API element is subject to removal in a future version.since 1905, not needed by the generic structure service
-
setCmsSupportedAbstractTypecodes
@Deprecated(since="1905", forRemoval=true) public void setCmsSupportedAbstractTypecodes(java.util.Set<java.lang.String> cmsSupportedAbstractTypecodes)Deprecated, for removal: This API element is subject to removal in a future version.since 1905, not needed by the generic structure service
-
getTypeService
protected TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
-