public abstract class ProductComponentGeneration extends RuntimeObject implements IProductComponentGeneration, IXmlPersistenceSupport
Deliberately implements IXmlPersistenceSupport directly. Letting
IProductComponentGeneration extend IXmlPersistenceSupport would have published
it, which is undesired.
| Constructor and Description |
|---|
ProductComponentGeneration(ProductComponent productCmpt) |
| Modifier and Type | Method and Description |
|---|---|
static void |
addToCardinalityMap(Map<String,org.faktorips.valueset.IntegerRange> cardinalityMap,
String targetId,
Element relationElement)
This method for implementations of the
doInitReferencesFromXml method to read
the cardinality bounds from an xml dom element. |
IConfigurableModelObject |
createPolicyComponent()
Creates a new policy component that is configured by this product component generation.
|
protected void |
doInitFormulaFromXml(Element genElement)
Initializes all formulas contained by genElement.
|
protected void |
doInitPropertiesFromXml(Map<String,Element> map)
Initializes the properties with the data in the map.
|
protected void |
doInitReferencesFromXml(Map<String,List<Element>> map)
Initializes the links with the data in the map.
|
protected void |
doInitTableUsagesFromXml(Map<String,Element> map)
Initializes the table content usages with the data in the map.
|
protected void |
doInitValidationRuleConfigsFromXml(Element genElement)
Creates a map containing the validation rule configurations found in the indicated
generation's XML element.
|
protected NodeList |
getEnumNodeList(Element configElement) |
IFormulaEvaluator |
getFormulaEvaluator() |
IProductComponentLink<? extends IProductComponent> |
getLink(String linkName,
IProductComponent target)
Returns the
IProductComponentLink for the association with the given role name
to the given product component or null if no such association exists. |
List<IProductComponentLink<? extends IProductComponent>> |
getLinks()
Returns a
List of all the IProductComponentLinks from this product
component generation to other product components. |
IProductComponentGeneration |
getNextGeneration()
Returns the next generation if available if not
null will be returned. |
IProductComponentGeneration |
getPreviousGeneration()
Returns the previous generation if available if not
null will be returned. |
IProductComponent |
getProductComponent()
Returns the product component this generation belongs to.
|
protected Element |
getRangeElement(Element configElement) |
IRuntimeRepository |
getRepository()
Returns the repository this product component generation belongs to.
|
Date |
getValidFrom(TimeZone zone)
Returns the point in time this generation is valid from in the given time zone.
|
long |
getValidFromInMillisec(TimeZone zone) |
void |
initFromXml(Element genElement)
Initializes the generation with the data from the xml element.
|
protected boolean |
isFormulaAvailable(String formularSignature) |
boolean |
isValidationRuleActivated(String ruleName)
Returns whether the validation rule with the given name is configured as active in this
ProductComponent. |
protected void |
setProductCmpt(ProductComponent productCmpt)
Sets the product component this generation belongs to.
|
void |
setValidFrom(DateTime newValidFrom)
Sets the new valid from date.
|
String |
toString() |
Element |
toXml(Document document)
Creates an XML
Element that represents this product component generation's data. |
protected void |
writeFormulaToXml(Element element) |
protected void |
writePropertiesToXml(Element generationElement)
Subclasses override this method to write their properties into the given XML element.
|
protected void |
writeReferencesToXml(Element element)
This is a utility method called by generated code.
|
protected void |
writeReferenceToXml(Element element,
IProductComponentLink<? extends IProductComponent> link) |
protected void |
writeTableUsagesToXml(Element element)
This is a utility method called by generated code.
|
protected void |
writeTableUsageToXml(Element element,
String structureUsage,
String tableContentName) |
protected void |
writeValidationRuleConfigsToXml(Element genElement) |
getExtensionPropertyIds, getExtensionPropertyValue, initExtensionPropertiesFromXml, writeExtensionPropertiesToXml, writeExtensionPropertiesToXmlclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetExtensionPropertyIds, getExtensionPropertyValuepublic ProductComponentGeneration(ProductComponent productCmpt)
public IConfigurableModelObject createPolicyComponent()
createPolicyComponent in interface IProductComponentGenerationpublic final IProductComponent getProductComponent()
IProductComponentGenerationnull.getProductComponent in interface IProductComponentGenerationpublic final IProductComponentGeneration getPreviousGeneration()
IProductComponentGenerationnull will be returned.getPreviousGeneration in interface IProductComponentGenerationpublic final IProductComponentGeneration getNextGeneration()
IProductComponentGenerationnull will be returned.getNextGeneration in interface IProductComponentGenerationpublic IRuntimeRepository getRepository()
IProductComponentGenerationnull.getRepository in interface IProductComponentGenerationgetRepository in interface IProductComponentLinkSourceIRuntimeRepository that was used to create this
IProductComponentLinkSourcepublic final long getValidFromInMillisec(TimeZone zone)
public final Date getValidFrom(TimeZone zone)
IProductComponentGenerationnull.getValidFrom in interface IProductComponentGenerationpublic void setValidFrom(DateTime newValidFrom)
IllegalRepositoryModificationException - if the repository this
generation belongs to does not allow to modify its contents. The method is
provided to ease the development of test cases.public IFormulaEvaluator getFormulaEvaluator()
public void initFromXml(Element genElement)
initFromXml in interface IClRepositoryObjectIllegalRepositoryModificationException - if the component has already been initialized
and the repository prohibit changing its contents.NullPointerException - if genElement is null.protected void doInitPropertiesFromXml(Map<String,Element> map)
map - the map of property elementsprotected void doInitReferencesFromXml(Map<String,List<Element>> map)
map - the map of property elementsprotected void doInitTableUsagesFromXml(Map<String,Element> map)
map - the map of property elementsprotected void doInitFormulaFromXml(Element genElement)
IPSPV-199 : changed that availableFormulas is not overridden, because if the
method initFromXML is called twice, the product variant would have no formulas.
SW 29.02.2012: TODO ProductVariants call initFromXML() twice. As of yet no formulas can be
varied and thus the formula-evaluator should not be overridden if it already exists. This is
a rather dirty fix for the current problems. A clean solution would be to extend the
IFormulaEvaluator interface with an updateExpression() method, that will then be
called for each formula found in the XML. see FIPS-995
protected boolean isFormulaAvailable(String formularSignature)
protected void doInitValidationRuleConfigsFromXml(Element genElement)
ValidationRuleConfiguration instance as value.
IPSPV-199 : removed the cleaning of nameToValidationRuleConfigMap because if the
method initFromXML is called twice, the product variant would have no validation
rules when cleaning is used.
genElement - An XML element containing a product component generation's data.NullPointerException - if genElement is null.public static void addToCardinalityMap(Map<String,org.faktorips.valueset.IntegerRange> cardinalityMap, String targetId, Element relationElement)
doInitReferencesFromXml method to read
the cardinality bounds from an xml dom element. An IntegerRange object is created and added
to the provided cardinalityMap.protected void setProductCmpt(ProductComponent productCmpt)
public IProductComponentLink<? extends IProductComponent> getLink(String linkName, IProductComponent target)
IProductComponentGenerationIProductComponentLink for the association with the given role name
to the given product component or null if no such association exists.getLink in interface IProductComponentGenerationpublic List<IProductComponentLink<? extends IProductComponent>> getLinks()
IProductComponentGenerationList of all the IProductComponentLinks from this product
component generation to other product components.getLinks in interface IProductComponentGenerationpublic boolean isValidationRuleActivated(String ruleName)
ProductComponent.isValidationRuleActivated in interface IProductComponentGenerationruleName - the name of the rule in questiontrue if the rule was activated, false else.public Element toXml(Document document)
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.toXml in interface IXmlPersistenceSupportdocument - a document, that can be used to create XML elements.Element that represents this object as XML elementprotected void writeTableUsagesToXml(Element element)
Element is the element
representing this ProductComponentGeneration.element - the element all table usages should be added toprotected void writeTableUsageToXml(Element element, String structureUsage, String tableContentName)
protected void writeReferencesToXml(Element element)
Element is the element
representing this ProductComponentGeneration.element - the element all table usages should be added toprotected void writeReferenceToXml(Element element, IProductComponentLink<? extends IProductComponent> link)
protected void writeFormulaToXml(Element element)
protected void writeValidationRuleConfigsToXml(Element genElement)
protected void writePropertiesToXml(Element generationElement)
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.generationElement - the XML element to write the properties toCopyright © 2014. All rights reserved.