|
||||||||||
| 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.ProductComponent
public abstract class ProductComponent
Base class for all product components.
Deliberately implements IXmlPersistenceSupport directly. Letting
IProductComponent extend IXmlPersistenceSupport would have published it, which is
undesired.
| Constructor Summary | |
|---|---|
ProductComponent(IRuntimeRepository repository,
String id,
String productKindId,
String versionId)
Creates a new product component with the indicate id, kind id and version id. |
|
| Method Summary | |
|---|---|
protected void |
doInitFormulaFromXml(Element element)
Initializes all formulas contained by Element. |
protected void |
doInitPropertiesFromXml(Map<String,Element> map)
Initializes the properties with the data in the map. |
protected void |
doInitReferencesFromXml(Map<String,List<Element>> linkElements)
|
protected void |
doInitTableUsagesFromXml(Map<String,Element> map)
Initializes the table content usages with the data in the map. |
IFormulaEvaluator |
getFormulaEvaluator()
|
IProductComponentGeneration |
getGenerationBase(Calendar effectiveDate)
Returns the generation that is effective on the given date or null if no
generation is effective on that date. |
String |
getId()
Returns the product component's id that uniquely identifies it in the repository it belongs to. |
String |
getKindId()
Returns the id of the product component kind that this product component belongs to. |
IProductComponentGeneration |
getLatestProductComponentGeneration()
Returns the latest product component generation of the provided product component or null if non available. |
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. |
IRuntimeRepository |
getRepository()
Returns the repository this product component belongs to. |
DateTime |
getValidFrom()
Returns the date from which this product component is valid. |
Date |
getValidFrom(TimeZone zone)
Returns the date from which this product component is valid as a Date. |
DateTime |
getValidTo()
Returns the date when this product component expires. |
String |
getVersionId()
Returns the version id that identifies this product component in its kind. |
void |
initFromXml(Element cmptElement)
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. |
void |
setValidFrom(DateTime validfrom)
Sets the new valid from date. |
void |
setValidTo(DateTime validTo)
|
String |
toString()
|
Element |
toXml(Document document)
Creates an XML Element that represents this product component's data. |
Element |
toXml(Document document,
boolean includeGenerations)
Creates an XML Element that represents this product component'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 element)
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. |
| 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.IProductComponent |
|---|
createPolicyComponent, isChangingOverTime |
| Methods inherited from interface org.faktorips.runtime.IRuntimeObject |
|---|
getExtensionPropertyIds, getExtensionPropertyValue |
| Constructor Detail |
|---|
public ProductComponent(IRuntimeRepository repository,
String id,
String productKindId,
String versionId)
repository - The component registry the component uses to resolve references to other
components.id - The component's runtime id.productKindId - The component's kind idversionId - The component's version id
NullPointerException - if repository, id, productKindId, or versionId is
null.| Method Detail |
|---|
public String getKindId()
IProductComponent
getKindId in interface IProductComponentpublic String getVersionId()
IProductComponent
getVersionId in interface IProductComponentpublic final String getId()
IProductComponent
getId in interface IProductComponentpublic DateTime getValidFrom()
IProductComponent
getValidFrom in interface IProductComponentpublic Date getValidFrom(TimeZone zone)
IProductComponentDate. If this
product component supports generations this is the same valid from date as the first
generation.
getValidFrom in interface IProductComponentzone - The time zone which is used to calculate the returned valid from date.
public void setValidFrom(DateTime validfrom)
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, then to achieve data consistency clients must set the valid from date of the first generation, too.
IllegalRepositoryModificationException - if the repository this
product component belongs to does not allow to modify its contentsProductComponentGeneration.setValidFrom(DateTime)public DateTime getValidTo()
IProductComponentnull means no
end of the validity period.
getValidTo in interface IProductComponentpublic void setValidTo(DateTime validTo)
public IRuntimeRepository getRepository()
IProductComponentnull.
getRepository in interface IProductComponentgetRepository in interface IProductComponentLinkSourceIRuntimeRepository that was used to create this
IProductComponentLinkSourcepublic IProductComponentGeneration getGenerationBase(Calendar effectiveDate)
IProductComponentnull if no
generation is effective on that date.
getGenerationBase in interface IProductComponentpublic IProductComponentGeneration getLatestProductComponentGeneration()
IProductComponentnull if non available.
getLatestProductComponentGeneration in interface IProductComponentpublic IFormulaEvaluator getFormulaEvaluator()
public void initFromXml(Element cmptElement)
initFromXml in interface IClRepositoryObjectNullPointerException - if cmptElement is null.protected void doInitPropertiesFromXml(Map<String,Element> map)
map - the map of property elementsprotected void doInitTableUsagesFromXml(Map<String,Element> map)
map - the map of property elementsprotected void doInitFormulaFromXml(Element element)
protected boolean isFormulaAvailable(String formularSignature)
true if the expression of the given formulaSignature not empty.
protected void doInitReferencesFromXml(Map<String,List<Element>> linkElements)
linkElements - the XML elements used to initialize ProductComponentLink
instances.public String toString()
toString in class Objectpublic Element toXml(Document document)
Element that represents this product component'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 element
public Element toXml(Document document,
boolean includeGenerations)
Element that represents this product component's data.
Throws an UnsupportedOperationException if the support for toXml
("Generate toXml Support") is not activated in the FIPS standard builder.
document - a document, that can be used to create XML elements.includeGenerations - true if the created XML element should include the
data of all the product component's generations, false if generations
should be ignored when creating the XML output.protected void writePropertiesToXml(Element element)
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.
element - the XML element to write the properties toprotected void writeTableUsagesToXml(Element element)
Element is the element
representing this ProductComponent.
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 content
public IProductComponentLink<? extends IProductComponent> getLink(String linkName,
IProductComponent target)
IProductComponentIProductComponentLink for the association with the given role name
to the given product component or null if no such association exists.
getLink in interface IProductComponentpublic List<IProductComponentLink<? extends IProductComponent>> getLinks()
IProductComponentList of all the IProductComponentLinks from this product
component generation to other product components.
getLinks in interface IProductComponentprotected 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||