Class DefaultStructureTypeModeService

    • Field Detail

      • DEFAULT_EXPIRATION_TIME

        protected static final java.lang.Long DEFAULT_EXPIRATION_TIME
    • Constructor Detail

      • DefaultStructureTypeModeService

        public DefaultStructureTypeModeService()
    • Method Detail

      • getComponentTypeByCodeAndMode

        public ComponentTypeStructure getComponentTypeByCodeAndMode​(java.lang.String typeCode,
                                                                    StructureTypeMode structureTypeMode)
        Description copied from interface: StructureTypeModeService
        Get a single component type structure for a given structure type mode.
        Specified by:
        getComponentTypeByCodeAndMode in interface StructureTypeModeService
        Parameters:
        typeCode - - the _TYPECODE of the component type to retrieve from the base mode
        structureTypeMode - - the mode of the structure type
        Returns:
        the component type structure or null when the code and mode provided do not match any existing types
      • initializeComponentTypeDataSupplier

        protected com.google.common.base.Supplier<java.util.Map<java.lang.String,​java.util.Map<StructureTypeMode,​ComponentTypeStructure>>> initializeComponentTypeDataSupplier()
        Internal method to initialize the Map that will serve as a data store for this service.
        Returns:
        the supplier method to get the Map<String, Map<StructureTypeMode, ComponentTypeData>>
      • getComponentTypesByCodeInternal

        protected java.util.Map<StructureTypeMode,​ComponentTypeStructure> getComponentTypesByCodeInternal​(java.lang.String typeCode)
        Internal method to build the Map for a given type code.
        Parameters:
        typeCode - the Item Type Code
        Returns:
        a map where the keys are the StructureTypeMode and the values are ComponentTypeData
      • getAttributeDescriptor

        protected java.util.Optional<AttributeDescriptorModel> getAttributeDescriptor​(java.lang.String typecode,
                                                                                      java.lang.String qualifier)
      • applyStructureTypeModeData

        protected void applyStructureTypeModeData​(java.lang.String typeCode,
                                                  StructureTypeMode mode,
                                                  ComponentTypeStructure baseTypeStructure,
                                                  java.util.Set<ComponentTypeAttributeStructure> attributes,
                                                  java.util.Set<java.lang.String> attributeOrder)
        Apply the Structure Type Mode defined for this Type.
        Parameters:
        typeCode - the type code we are want to apply the mode into.
        mode - the mode definition
        baseTypeStructure - the base type Structure that is mode-agnostic.
        attributes - the pre-built set of attributes defined by the base.
        attributeOrder - the final attribute order
      • getStructureTypeModeData

        protected java.util.Deque<StructureTypeModeAttributeFilter> getStructureTypeModeData​(java.lang.String typeCode,
                                                                                             StructureTypeMode mode)
        Get the mode defintion for this type or its super type, if one does not exist.
        Parameters:
        typeCode - the type code that defines a mode.
        mode - the structure mode required for this type
        Returns:
        the StructureTypeModeData defined in the configuration, or empty() if none.
      • getStructureTypeModeData

        protected void getStructureTypeModeData​(java.lang.String typeCode,
                                                StructureTypeMode mode,
                                                java.util.Deque<StructureTypeModeAttributeFilter> structureModeDataList)
        Recursively collects the the mode definition for its type and for its parent's type.
        Parameters:
        typeCode - the current type code possibly owning the mode definition
        mode - the mode definition
        structureModeDataList - the final list of modes collected.
      • setAttributePosition

        protected void setAttributePosition​(ComponentTypeAttributeStructure attribute,
                                            java.util.Set<java.lang.String> attributeOrder)
        Sets the attribute's position to be equal to the position of the attribute in the ordered list, or to be Integer.MAX_VALUE, if the attribute is not present in the ordered list.
        Parameters:
        attribute - the ComponentTypeAttributeStructure we want to set the position
        attributeOrder - the ordered list
      • getComponentTypeDataSupplierMap

        protected com.google.common.base.Supplier<java.util.Map<java.lang.String,​java.util.Map<StructureTypeMode,​ComponentTypeStructure>>> getComponentTypeDataSupplierMap()
      • initializeInternalStructureMap

        protected com.google.common.base.Supplier<java.util.Map<java.lang.String,​java.util.Map<StructureTypeMode,​ComponentTypeStructure>>> initializeInternalStructureMap​(java.lang.Long expirationTime)
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
      • getTypeService

        protected TypeService getTypeService()
      • setTypeService

        public void setTypeService​(TypeService typeService)
      • setComponentTypeStructureService

        public void setComponentTypeStructureService​(ComponentTypeStructureService componentTypeStructureService)
      • setConfigurationService

        public void setConfigurationService​(ConfigurationService configurationService)