Class ProductComponentGeneration

    • Constructor Detail

      • ProductComponentGeneration

        public ProductComponentGeneration​(ProductComponent productCmpt)
    • Method Detail

      • createPolicyComponent

        public IConfigurableModelObject createPolicyComponent()
        Description copied from interface: IProductObject
        Creates a new policy component that is configured by this product component generation. After creating the policy component it is automatically initialized. The new policy component is not added to any parent structure.

        Specified by:
        createPolicyComponent in interface IProductObject
      • getValidFromInMillisec

        public final long getValidFromInMillisec​(java.util.TimeZone zone)
      • getValidFrom

        public DateTime getValidFrom()
        Description copied from interface: IProductObject
        Returns the date from which this generation is valid.
        Specified by:
        getValidFrom in interface IProductObject
        Returns:
        The valid from date of this generation
      • getValidFrom

        public final java.util.Date getValidFrom​(java.util.TimeZone zone)
        Description copied from interface: IProductObject
        Returns the point in time this generation is valid from in the given time zone. This method never returns null.
        Specified by:
        getValidFrom in interface IProductObject
      • setValidFrom

        public void setValidFrom​(DateTime newValidFrom)
        Sets the new valid from date.

        Attention: Conceptually, the valid from date of the first generation must be equal to the valid from date of the product component itself. Therefore, if clients call this method on the first generation of a product component, to achieve data consistency, clients must set the valid from date of the product component, too.

        Throws:
        IllegalRepositoryModificationException - if the repository this generation belongs to does not allow to modify its contents
        See Also:
        ProductComponent.setValidFrom(DateTime)
      • initFromXml

        public void initFromXml​(org.w3c.dom.Element genElement)
        Initializes the generation with the data from the xml element.
        Specified by:
        initFromXml in interface IClRepositoryObject
        Throws:
        IllegalRepositoryModificationException - if the component has already been initialized and the repository prohibit changing its contents.
        java.lang.NullPointerException - if genElement is null.
      • doInitPropertiesFromXml

        protected void doInitPropertiesFromXml​(java.util.Map<java.lang.String,​org.w3c.dom.Element> map)
        Initializes the properties with the data in the map.
        Parameters:
        map - the map of property elements
      • doInitReferencesFromXml

        protected void doInitReferencesFromXml​(java.util.Map<java.lang.String,​java.util.List<org.w3c.dom.Element>> map)
        Initializes the links with the data in the map.
        Parameters:
        map - the map of property elements
      • doInitTableUsagesFromXml

        protected void doInitTableUsagesFromXml​(java.util.Map<java.lang.String,​org.w3c.dom.Element> map)
        Initializes the table content usages with the data in the map. The map contains the table structure usage roles as key and the qualified table content name as value.
        Parameters:
        map - the map of property elements
      • doInitFormulaFromXml

        protected void doInitFormulaFromXml​(org.w3c.dom.Element genElement)
        Initializes all formulas contained by genElement. If formula evaluation is supported, the map contains the compiled expression for every formula.
      • isFormulaAvailable

        protected boolean isFormulaAvailable​(java.lang.String formularSignature)
        Returns true if the expression of the given formulaSignature not empty.
      • doInitValidationRuleConfigsFromXml

        protected void doInitValidationRuleConfigsFromXml​(org.w3c.dom.Element genElement)
        Creates a map containing the validation rule configurations found in the indicated generation's XML element. For each validation rule configuration the map contains an entry with the rule name as a key and an ValidationRuleConfiguration instance as value.
        Parameters:
        genElement - An XML element containing a product component generation's data.
        Throws:
        java.lang.NullPointerException - if genElement is null.
      • getRangeElement

        protected org.w3c.dom.Element getRangeElement​(org.w3c.dom.Element configElement)
      • getEnumNodeList

        protected org.w3c.dom.NodeList getEnumNodeList​(org.w3c.dom.Element configElement)
      • addToCardinalityMap

        public static void addToCardinalityMap​(java.util.Map<java.lang.String,​org.faktorips.valueset.IntegerRange> cardinalityMap,
                                               java.lang.String targetId,
                                               org.w3c.dom.Element relationElement)
        This method for implementations of the doInitReferencesFromXml method to read the cardinality bounds from an xml dom element. An IntegerRange object is created and added to the provided cardinalityMap.
      • setValidationRuleActivated

        public void setValidationRuleActivated​(java.lang.String ruleName,
                                               boolean active)
        Description copied from interface: IProductObject
        Enables or disables validation for a specific rule.
        Specified by:
        setValidationRuleActivated in interface IProductObject
        Parameters:
        ruleName - the name of the rule in question
        active - indicating whether the validation rule is configured as active
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setProductCmpt

        protected void setProductCmpt​(ProductComponent productCmpt)
        Sets the product component this generation belongs to.
      • isValidationRuleActivated

        public boolean isValidationRuleActivated​(java.lang.String ruleName)
        Description copied from interface: IProductObject
        Returns whether the validation rule with the given name is configured as active in this IProductObject. If there is no configuration for the given rule, false is returned.

        Please be aware that only one of IProductComponent or IProductComponentGeneration can configure any given rule depending on its changing-over-time configuration.

        Specified by:
        isValidationRuleActivated in interface IProductObject
        Parameters:
        ruleName - the name of the rule in question
        Returns:
        true if the rule was activated, false else.
      • toXml

        public org.w3c.dom.Element toXml​(org.w3c.dom.Document document)
        Creates an XML Element that represents this product component generation's data.

        Throws an UnsupportedOperationException if the support for toXml ("Generate toXml Support") is not activated in the FIPS standard builder.

        Specified by:
        toXml in interface IXmlPersistenceSupport
        Parameters:
        document - a document, that can be used to create XML elements.
        Returns:
        an Element that represents this object as XML element
      • writeTableUsagesToXml

        protected void writeTableUsagesToXml​(org.w3c.dom.Element element)
        This is a utility method called by generated code. The given Element is the element representing this ProductComponentGeneration.
        Parameters:
        element - the element all table usages should be added to
      • writeTableUsageToXml

        protected void writeTableUsageToXml​(org.w3c.dom.Element element,
                                            java.lang.String structureUsage,
                                            java.lang.String tableContentName)
        This method is used for writing a table usage to the XML of the given Element.
        Parameters:
        element - the element where the table usage will be added to
        structureUsage - the value for the structureUsage XML attribute
        tableContentName - the name of the used table content
      • writeReferencesToXml

        protected void writeReferencesToXml​(org.w3c.dom.Element element)
        This is a utility method called by generated code. The given Element is the element representing this ProductComponentGeneration.
        Parameters:
        element - the element all table usages should be added to
      • writeFormulaToXml

        protected void writeFormulaToXml​(org.w3c.dom.Element element)
        This method is used for writing a formulas to the XML of the given Element.
      • writeValidationRuleConfigsToXml

        protected void writeValidationRuleConfigsToXml​(org.w3c.dom.Element genElement)
      • writePropertiesToXml

        protected void writePropertiesToXml​(org.w3c.dom.Element generationElement)
        Subclasses override this method to write their properties into the given XML element.

        The standard implementation throws an UnsupportedOperationException if the support for toXml ("Generate toXml Support") is not activated in the FIPS standard builder. Generated classes override but do NOT call super.

        Parameters:
        generationElement - the XML element to write the properties to