|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.faktorips.runtime.internal.RuntimeObject
org.faktorips.runtime.internal.ProductComponentGeneration
public abstract class ProductComponentGeneration
Base class for product component generations
Deliberately implements IXmlPersistenceSupport directly. Letting
IProductComponentGeneration extend IXmlPersistenceSupport would have published
it, which is undesired.
| Constructor Summary | |
|---|---|
ProductComponentGeneration(ProductComponent productCmpt)
|
|
| Method Summary | |
|---|---|
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. |
DateTime |
getValidFrom()
Returns the date from which this generation is valid. |
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)
Returns true if the expression of the given formulaSignature not empty. |
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)
This method is used for writing a formulas to the XML of the given 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 |
writeTableUsagesToXml(Element element)
This is a utility method called by generated code. |
protected void |
writeTableUsageToXml(Element element,
String structureUsage,
String tableContentName)
This method is used for writing a table usage to the XML of the given Element. |
protected void |
writeValidationRuleConfigsToXml(Element genElement)
|
| Methods inherited from class org.faktorips.runtime.internal.RuntimeObject |
|---|
getExtensionPropertyIds, getExtensionPropertyValue, initExtensionPropertiesFromXml, writeExtensionPropertiesToXml, writeExtensionPropertiesToXml |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.faktorips.runtime.IRuntimeObject |
|---|
getExtensionPropertyIds, getExtensionPropertyValue |
| Constructor Detail |
|---|
public ProductComponentGeneration(ProductComponent productCmpt)
| Method Detail |
|---|
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 DateTime getValidFrom()
IProductComponentGeneration
getValidFrom in interface IProductComponentGenerationpublic final Date getValidFrom(TimeZone zone)
IProductComponentGenerationnull.
getValidFrom in interface IProductComponentGenerationpublic void setValidFrom(DateTime newValidFrom)
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.
IllegalRepositoryModificationException - if the repository this
generation belongs to does not allow to modify its contentsProductComponent.setValidFrom(DateTime)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)
protected boolean isFormulaAvailable(String formularSignature)
true if the expression of the given formulaSignature not empty.
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.protected Element getRangeElement(Element configElement)
protected NodeList getEnumNodeList(Element configElement)
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.
public String toString()
toString in class Objectprotected 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 question
true 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 to
protected void writeTableUsageToXml(Element element,
String structureUsage,
String tableContentName)
Element.
element - the element where the table usage will be added tostructureUsage - the value for the structureUsage XML attributetableContentName - the name of the used table contentprotected void writeReferencesToXml(Element element)
Element is the element
representing this ProductComponentGeneration.
element - the element all table usages should be added toprotected void writeFormulaToXml(Element 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 to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||