Class 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 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 Detail

      • DefaultComponentTypeStructureRegistry

        public DefaultComponentTypeStructureRegistry()
    • Method Detail

      • getComponentTypeAttributeStructure

        public java.util.Optional<ComponentTypeAttributeStructure> getComponentTypeAttributeStructure​(java.lang.String typecode,
                                                                                                      java.lang.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
      • getAbstractComponentTypeStructure

        @Deprecated
        public ComponentTypeStructure getAbstractComponentTypeStructure​(java.lang.String itemType)
        Deprecated.
        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​(java.lang.String abstractTypeCode,
                                              java.lang.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
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.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 ComponentTypeStructure instance.
      • 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)
      • setAllComponentTypeAttributeStructures

        public void setAllComponentTypeAttributeStructures​(java.util.Set<ComponentTypeAttributeStructure> allComponentTypeAttributeStructures)
      • 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)