public abstract class ProductComponent extends RuntimeObject implements IProductComponent, IXmlPersistenceSupport
Deliberately implements IXmlPersistenceSupport directly. Letting
IProductComponent extend IXmlPersistenceSupport would have published it, which is
undesired.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ATTRIBUTE_NAME_VARIED_PRODUCT_CMPT |
| Constructor and Description |
|---|
ProductComponent(IRuntimeRepository repository,
String id,
String productKindId,
String versionId)
Creates a new product component with the indicate id, kind id and version id.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
String |
getDescription(Locale locale)
Returns the description for this product component in the specified locale.
|
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 generation is valid.
|
Date |
getValidFrom(TimeZone zone)
Returns the point in time this generation is valid from in the given time zone.
|
DateTime |
getValidTo()
Returns the date when this product component expires.
|
IProductComponent |
getVariedBase()
Allows distinguishing variants not only by their product component type but also their varied
base.
|
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. |
boolean |
isVariant()
A variant is a product component that is based on another product component (hence varied
base).
|
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. |
getExtensionPropertyIds, getExtensionPropertyValue, initExtensionPropertiesFromXml, writeExtensionPropertiesToXml, writeExtensionPropertiesToXmlclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisChangingOverTimegetExtensionPropertyIds, getExtensionPropertyValuecreatePolicyComponentprotected static final String ATTRIBUTE_NAME_VARIED_PRODUCT_CMPT
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 idNullPointerException - if repository, id, productKindId, or versionId is
null.public String getKindId()
IProductComponentgetKindId in interface IProductComponentpublic String getVersionId()
IProductComponentgetVersionId in interface IProductComponentpublic String getId()
IProductComponentgetId in interface IProductComponentpublic boolean isVariant()
IProductComponentisVariant in interface IProductComponenttrue if this is a variant of another IProductComponent,
false for regular product components.IProductComponent.getVariedBase()public IProductComponent getVariedBase()
IProductComponentIProductComponent.isVariant() allows determining whether a product component is a variant.getVariedBase in interface IProductComponentIProductComponent this IProductComponent is based on. Returns
null if it is a regular product component or the variedBase can not be found in the IRuntimeRepository.IProductComponent.isVariant(),
IRuntimeRepository.getProductComponent(String)public DateTime getValidFrom()
IProductObjectgetValidFrom in interface IProductObjectpublic Date getValidFrom(TimeZone zone)
IProductObjectnull.getValidFrom in interface IProductObjectpublic 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 String getDescription(Locale locale)
IProductComponentgetDescription in interface IProductComponentpublic 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 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 elementpublic 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)
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.
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 toprotected 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 contentpublic IProductComponentLink<? extends IProductComponent> getLink(String linkName, IProductComponent target)
IProductComponentLinkSourceIProductComponentLink for the association with the given role name
to the given product component or null if no such association exists.getLink in interface IProductComponentLinkSourcepublic List<IProductComponentLink<? extends IProductComponent>> getLinks()
IProductComponentLinkSourceList of all the IProductComponentLinks from this product
component generation to other product components.getLinks in interface IProductComponentLinkSourceprotected void writeReferencesToXml(Element element)
Element is the element
representing this ProductComponentGeneration.element - the element all table usages should be added toCopyright © 2018. All rights reserved.