Class ProductComponentGeneration
- All Implemented Interfaces:
IClRepositoryObject,IXmlPersistenceSupport,IProductComponentGeneration,IProductComponentLinkSource,IProductObject,IRuntimeObject
Deliberately implements IXmlPersistenceSupport directly. Letting
IProductComponentGeneration extend IXmlPersistenceSupport would have published
it, which is undesired.
-
Field Summary
Fields inherited from interface org.faktorips.runtime.IProductObject
PROPERTY_VALID_FROM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddToCardinalityMap(Map<String, org.faktorips.valueset.IntegerRange> cardinalityMap, String targetId, Element relationElement) This method for implementations of thedoInitReferencesFromXmlmethod to read the cardinality bounds from an xml dom element.Creates a new policy component that is configured by this product component generation.protected voiddoInitFormulaFromXml(Element genElement) Initializes all formulas contained by genElement.protected voidInitializes the properties with the data in the map.protected voiddoInitReferencesFromXml(Map<String, List<Element>> map) Initializes the links with the data in the map.protected voidInitializes the table content usages with the data in the map.protected voiddoInitValidationRuleConfigsFromXml(Element genElement) Creates a map containing the validation rule configurations found in the indicated generation's XML element.protected NodeListgetEnumNodeList(Element configElement) IProductComponentLink<? extends IProductComponent>getLink(String linkName, IProductComponent target) Returns theIProductComponentLinkfor the association with the given role name to the given product component ornullif no such association exists.List<IProductComponentLink<? extends IProductComponent>>getLinks()Returns aListof all theIProductComponentLinks from this product component generation to other product components.Returns the next generation if available if notnullwill be returned.Returns the previous generation if available if notnullwill be returned.final IProductComponentReturns the product component this generation belongs to.protected ElementgetRangeElement(Element configElement) Returns the repository this product component generation belongs to.Returns the date from which this generation is valid.final DategetValidFrom(TimeZone zone) Returns the point in time this generation is valid from in the given time zone.final longvoidinitFromXml(Element genElement) Initializes the generation with the data from the xml element.protected booleanisFormulaAvailable(String formularSignature) Returnstrueif the expression of the given formulaSignature not empty.booleanisValidationRuleActivated(String ruleName) Returns whether the validation rule with the given name is configured as active in thisIProductObject.protected voidsetProductCmpt(ProductComponent productCmpt) Sets the product component this generation belongs to.voidsetValidationRuleActivated(String ruleName, boolean active) Enables or disables validation for a specific rule.voidsetValidFrom(DateTime newValidFrom) Sets the new valid from date.toString()Creates an XMLElementthat represents this product component generation's data.protected voidwriteFormulaToXml(Element element) This method is used for writing a formulas to the XML of the givenElement.protected voidwritePropertiesToXml(Element generationElement) Subclasses override this method to write their properties into the given XML element.protected voidwriteReferencesToXml(Element element) This is a utility method called by generated code.protected voidwriteTableUsagesToXml(Element element) This is a utility method called by generated code.protected voidwriteTableUsageToXml(Element element, String structureUsage, String tableContentName) This method is used for writing a table usage to the XML of the givenElement.protected voidwriteValidationRuleConfigsToXml(Element genElement) Methods inherited from class org.faktorips.runtime.internal.RuntimeObject
getExtensionPropertyIds, getExtensionPropertyValue, initExtensionPropertiesFromXml, writeExtensionPropertiesToXml, writeExtensionPropertiesToXmlMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.faktorips.runtime.IRuntimeObject
getExtensionPropertyIds, getExtensionPropertyValue
-
Constructor Details
-
ProductComponentGeneration
-
-
Method Details
-
createPolicyComponent
Description copied from interface:IProductObjectCreates 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:
createPolicyComponentin interfaceIProductObject
-
getProductComponent
Description copied from interface:IProductComponentGenerationReturns the product component this generation belongs to. This method never returnsnull.- Specified by:
getProductComponentin interfaceIProductComponentGeneration
-
getPreviousGeneration
Description copied from interface:IProductComponentGenerationReturns the previous generation if available if notnullwill be returned.- Specified by:
getPreviousGenerationin interfaceIProductComponentGeneration
-
getNextGeneration
Description copied from interface:IProductComponentGenerationReturns the next generation if available if notnullwill be returned.- Specified by:
getNextGenerationin interfaceIProductComponentGeneration
-
getRepository
Description copied from interface:IProductComponentGenerationReturns the repository this product component generation belongs to. This method never returnsnull.- Specified by:
getRepositoryin interfaceIProductComponentGeneration- Specified by:
getRepositoryin interfaceIProductComponentLinkSource- Returns:
- The
IRuntimeRepositorythat was used to create thisIProductComponentLinkSource
-
getValidFromInMillisec
-
getValidFrom
Description copied from interface:IProductObjectReturns the date from which this generation is valid.- Specified by:
getValidFromin interfaceIProductObject- Returns:
- The valid from date of this generation
-
getValidFrom
Description copied from interface:IProductObjectReturns the point in time this generation is valid from in the given time zone. This method never returnsnull.- Specified by:
getValidFromin interfaceIProductObject
-
setValidFrom
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:
-
getFormulaEvaluator
-
initFromXml
Initializes the generation with the data from the xml element.- Specified by:
initFromXmlin interfaceIClRepositoryObject- Throws:
IllegalRepositoryModificationException- if the component has already been initialized and the repository prohibit changing its contents.NullPointerException- if genElement isnull.
-
doInitPropertiesFromXml
Initializes the properties with the data in the map.- Parameters:
map- the map of property elements
-
doInitReferencesFromXml
Initializes the links with the data in the map.- Parameters:
map- the map of property elements
-
doInitTableUsagesFromXml
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
Initializes all formulas contained by genElement. If formula evaluation is supported, the map contains the compiled expression for every formula. -
isFormulaAvailable
Returnstrueif the expression of the given formulaSignature not empty. -
doInitValidationRuleConfigsFromXml
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 anValidationRuleConfigurationinstance as value.- Parameters:
genElement- An XML element containing a product component generation's data.- Throws:
NullPointerException- if genElement isnull.
-
getRangeElement
-
getEnumNodeList
-
addToCardinalityMap
public static void addToCardinalityMap(Map<String, org.faktorips.valueset.IntegerRange> cardinalityMap, String targetId, Element relationElement) This method for implementations of thedoInitReferencesFromXmlmethod to read the cardinality bounds from an xml dom element. An IntegerRange object is created and added to the provided cardinalityMap. -
setValidationRuleActivated
Description copied from interface:IProductObjectEnables or disables validation for a specific rule.- Specified by:
setValidationRuleActivatedin interfaceIProductObject- Parameters:
ruleName- the name of the rule in questionactive- indicating whether the validation rule is configured as active
-
toString
-
setProductCmpt
Sets the product component this generation belongs to. -
getLink
public IProductComponentLink<? extends IProductComponent> getLink(String linkName, IProductComponent target) Description copied from interface:IProductComponentLinkSourceReturns theIProductComponentLinkfor the association with the given role name to the given product component ornullif no such association exists.- Specified by:
getLinkin interfaceIProductComponentLinkSource
-
getLinks
Description copied from interface:IProductComponentLinkSourceReturns aListof all theIProductComponentLinks from this product component generation to other product components.- Specified by:
getLinksin interfaceIProductComponentLinkSource
-
isValidationRuleActivated
Description copied from interface:IProductObjectReturns whether the validation rule with the given name is configured as active in thisIProductObject. If there is no configuration for the given rule,falseis returned.Please be aware that only one of
IProductComponentorIProductComponentGenerationcan configure any given rule depending on its changing-over-time configuration.- Specified by:
isValidationRuleActivatedin interfaceIProductObject- Parameters:
ruleName- the name of the rule in question- Returns:
trueif the rule was activated,falseelse.
-
toXml
Creates an XMLElementthat represents this product component generation's data.Throws an
UnsupportedOperationExceptionif the support for toXml ("Generate toXml Support") is not activated in the FIPS standard builder.- Specified by:
toXmlin interfaceIXmlPersistenceSupport- Parameters:
document- a document, that can be used to create XML elements.- Returns:
- an
Elementthat represents this object as XML element
-
writeTableUsagesToXml
This is a utility method called by generated code. The givenElementis the element representing thisProductComponentGeneration.- Parameters:
element- the element all table usages should be added to
-
writeTableUsageToXml
protected void writeTableUsageToXml(Element element, String structureUsage, String tableContentName) This method is used for writing a table usage to the XML of the givenElement.- Parameters:
element- the element where the table usage will be added tostructureUsage- the value for the structureUsage XML attributetableContentName- the name of the used table content
-
writeReferencesToXml
This is a utility method called by generated code. The givenElementis the element representing thisProductComponentGeneration.- Parameters:
element- the element all table usages should be added to
-
writeFormulaToXml
This method is used for writing a formulas to the XML of the givenElement. -
writeValidationRuleConfigsToXml
-
writePropertiesToXml
Subclasses override this method to write their properties into the given XML element.The standard implementation throws an
UnsupportedOperationExceptionif 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
-