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 Details

    • DefaultComponentTypeStructureRegistry

      public DefaultComponentTypeStructureRegistry()
  • Method Details

    • getComponentTypeAttributeStructure

      public Optional<ComponentTypeAttributeStructure> getComponentTypeAttributeStructure(String typecode, String qualifier)
      Description copied from interface: ComponentTypeStructureRegistry
      Get a specific ComponentTypeAttributeStructure by typecode and qualifier.
      Specified by:
      getComponentTypeAttributeStructure in interface ComponentTypeStructureRegistry
      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(String typecode)
      Description copied from interface: ComponentTypeStructureRegistry
      Get a specific ComponentTypeStructure by its typecode.
      Specified by:
      getComponentTypeStructure in interface ComponentTypeStructureRegistry
      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 service
      Get a specific ComponentTypeStructure of an Abstract type by its itemtype.
      Specified by:
      getAbstractComponentTypeStructure in interface ComponentTypeStructureRegistry
      Parameters:
      itemType - - the itemtype of the element to retrieve from the registry.
      Returns:
      the element matching the itemtype
    • matchesComposedType

      protected boolean matchesComposedType(String abstractTypeCode, String itemType)
      Verifies that the given typecode has the same ComposedType as the provided itemtype.
      Parameters:
      abstractTypeCode - - the typecode which ComposedType will be compared
      itemType - - the itemtype used for comparison
      Returns:
      TRUE if the ComposedType of the given typecode matches the itemtype specified; FALSE otherwise
    • getComponentTypeStructures

      public Collection<ComponentTypeStructure> getComponentTypeStructures()
      Description copied from interface: ComponentTypeStructureRegistry
      Get all elements in the registry.
      Specified by:
      getComponentTypeStructures in interface ComponentTypeStructureRegistry
      Returns:
      all items in the registry or an empty collection if no elements are found.
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      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 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

      protected ComponentTypeStructure getOrCreateComponentTypeStructure(String typeCode)
      Gets or Creates a new Component Type Structure.
      Parameters:
      typeCode - the type code used to get the
      Returns:
      the ComponentTypeStructure instance.
    • getComponentTypeStructureMap

      protected Map<String,ComponentTypeStructure> getComponentTypeStructureMap()
    • getAllComponentTypeStructures

      protected Set<ComponentTypeStructure> getAllComponentTypeStructures()
    • setAllComponentTypeStructures

      public void setAllComponentTypeStructures(Set<ComponentTypeStructure> allComponentTypeStructures)
    • getAllComponentTypeAttributeStructures

      protected Set<ComponentTypeAttributeStructure> getAllComponentTypeAttributeStructures()
    • setAllComponentTypeAttributeStructures

      public void setAllComponentTypeAttributeStructures(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 Set<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(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

      protected TypeService getTypeService()
    • setTypeService

      public void setTypeService(TypeService typeService)