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 Object
implements ComponentTypeStructureRegistry, org.springframework.beans.factory.InitializingBean
Default implementation of the
ComponentTypeStructureRegistry. This implementation uses autowire-by-type
to inject all beans implementing ComponentTypeStructure and ComponentTypeAttributeStructure.
All ComponentTypeStructure and ComponentTypeAttributeStructure elements will be merged into
a single set of elements that will represent the single source of truth for the Structure API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetAbstractComponentTypeStructure(String itemType) Deprecated, for removal: This API element is subject to removal in a future version.since 1905, not needed by the generic structure serviceprotected Set<ComponentTypeAttributeStructure>protected Set<ComponentTypeStructure>Deprecated, for removal: This API element is subject to removal in a future version.since 1905, not needed by the generic structure servicegetComponentTypeAttributeStructure(String typecode, String qualifier) Get a specificComponentTypeAttributeStructureby typecode and qualifier.getComponentTypeStructure(String typecode) Get a specificComponentTypeStructureby its typecode.protected Map<String,ComponentTypeStructure> Get all elements in the registry.protected FacadeValidationServiceprotected ComponentTypeStructuregetOrCreateComponentTypeStructure(String typeCode) Gets or Creates a new Component Type Structure.protected org.springframework.validation.Validatorprotected TypeServiceprotected booleanmatchesComposedType(String abstractTypeCode, String itemType) Verifies that the given typecode has the sameComposedTypeas the provided itemtype.protected voidIf the map of component type structures is empty, then add this element to the map.voidsetAllComponentTypeAttributeStructures(Set<ComponentTypeAttributeStructure> allComponentTypeAttributeStructures) voidsetAllComponentTypeStructures(Set<ComponentTypeStructure> allComponentTypeStructures) voidsetCmsSupportedAbstractTypecodes(Set<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.
-
Constructor Details
-
DefaultComponentTypeStructureRegistry
public DefaultComponentTypeStructureRegistry()
-
-
Method Details
-
getComponentTypeAttributeStructure
public Optional<ComponentTypeAttributeStructure> getComponentTypeAttributeStructure(String typecode, 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
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(since="1905", forRemoval=true) public ComponentTypeStructure getAbstractComponentTypeStructure(String itemType) Deprecated, for removal: This API element is subject to removal in a future version.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
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
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
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
putOrUpdateStructureType
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 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:
IllegalArgumentException- when the typecode provided in the attributes does not match any component type structure in the map.
-
getOrCreateComponentTypeStructure
Gets or Creates a new Component Type Structure.- Parameters:
typeCode- the type code used to get the- Returns:
- the
ComponentTypeStructureinstance.
-
getComponentTypeStructureMap
-
getAllComponentTypeStructures
-
setAllComponentTypeStructures
-
getAllComponentTypeAttributeStructures
-
setAllComponentTypeAttributeStructures
public void setAllComponentTypeAttributeStructures(Set<ComponentTypeAttributeStructure> allComponentTypeAttributeStructures) -
getFacadeValidationService
-
setFacadeValidationService
-
getStructureTypesPostCreationValidator
protected org.springframework.validation.Validator getStructureTypesPostCreationValidator() -
setStructureTypesPostCreationValidator
public void setStructureTypesPostCreationValidator(org.springframework.validation.Validator structureTypesPostCreationValidator) -
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(Set<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
-
setTypeService
-