Package org.faktorips.runtime.internal
Class ProductComponentLink<T extends IProductComponent>
- java.lang.Object
-
- org.faktorips.runtime.internal.RuntimeObject
-
- org.faktorips.runtime.internal.ProductComponentLink<T>
-
- All Implemented Interfaces:
IClRepositoryObject,IXmlPersistenceSupport,IProductComponentLink<T>,IRuntimeObject
public class ProductComponentLink<T extends IProductComponent> extends RuntimeObject implements IProductComponentLink<T>, IXmlPersistenceSupport
Class that represents a link/relation between product components.As of FIPS 3.2 the cardinalities standard OPTIONAL, OBLIGATORY and FULL_RANGE are provided by the
CardinalityRangeclass.- See Also:
CardinalityRange
-
-
Constructor Summary
Constructors Constructor Description ProductComponentLink(IProductComponentGeneration source)Creates a new link for the given product component generation.ProductComponentLink(IProductComponentGeneration source, T target)Creates a new link to the given target for the given product component generation using the cardinality (0,*).ProductComponentLink(IProductComponentGeneration source, T target, CardinalityRange cardinality)Creates a new link with the given cardinality to the given target for the given product component generation.ProductComponentLink(IProductComponentLinkSource source)Creates a new link for the given product component/generation.ProductComponentLink(IProductComponentLinkSource source, T target)Creates a new link to the given target for the given product component/generation using the cardinality (0,*).ProductComponentLink(IProductComponentLinkSource source, T target, java.lang.String associationName)Creates a new link to the given target and association name for the given product component/generation using the cardinality (0,*).ProductComponentLink(IProductComponentLinkSource source, T target, CardinalityRange cardinality)Creates a new link with the given cardinality to the given target for the given product component/generation.ProductComponentLink(IProductComponentLinkSource source, T target, CardinalityRange cardinality, java.lang.String associationName)Creates a new link with the cardinality and association name to the given target for the given product component/generation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAssociationName()Returns the name of the association this link belongs to.CardinalityRangegetCardinality()IProductComponentLinkSourcegetSource()Returns theIProductComponentLinkSourcethis link originates from.TgetTarget()Returns the target product component.java.lang.StringgetTargetId()Returns the target product component's id.voidinitFromXml(org.w3c.dom.Element element)Initializes this object with the data stored in the XML element.java.lang.StringtoString()org.w3c.dom.ElementtoXml(org.w3c.dom.Document document)Creates anElement(using the given document) that represents this object in XML.-
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
-
ProductComponentLink
public ProductComponentLink(IProductComponentGeneration source)
Creates a new link for the given product component generation. Target and cardinality must be set by invokinginitFromXml.
-
ProductComponentLink
public ProductComponentLink(IProductComponentGeneration source, T target)
Creates a new link to the given target for the given product component generation using the cardinality (0,*).- Throws:
java.lang.NullPointerException- if any of the parameters isnull.
-
ProductComponentLink
public ProductComponentLink(IProductComponentGeneration source, T target, CardinalityRange cardinality)
Creates a new link with the given cardinality to the given target for the given product component generation.- Throws:
java.lang.NullPointerException- if any of the parameters isnull.
-
ProductComponentLink
public ProductComponentLink(IProductComponentLinkSource source)
Creates a new link for the given product component/generation. Target and cardinality must be set by invokinginitFromXml.
-
ProductComponentLink
public ProductComponentLink(IProductComponentLinkSource source, T target)
Creates a new link to the given target for the given product component/generation using the cardinality (0,*).- Throws:
java.lang.NullPointerException- if any of the parameters isnull.
-
ProductComponentLink
public ProductComponentLink(IProductComponentLinkSource source, T target, java.lang.String associationName)
Creates a new link to the given target and association name for the given product component/generation using the cardinality (0,*).- Throws:
java.lang.NullPointerException- if any of the parameters isnull.
-
ProductComponentLink
public ProductComponentLink(IProductComponentLinkSource source, T target, CardinalityRange cardinality)
Creates a new link with the given cardinality to the given target for the given product component/generation.- Throws:
java.lang.NullPointerException- if any of the parameters isnull.
-
ProductComponentLink
public ProductComponentLink(IProductComponentLinkSource source, T target, CardinalityRange cardinality, java.lang.String associationName)
Creates a new link with the cardinality and association name to the given target for the given product component/generation.- Throws:
java.lang.NullPointerException- if any of the parameters isnull.
-
-
Method Detail
-
getCardinality
public CardinalityRange getCardinality()
- Specified by:
getCardinalityin interfaceIProductComponentLink<T extends IProductComponent>- Returns:
- this link's min and max cardinality as a
IntegerRange.
-
initFromXml
public void initFromXml(org.w3c.dom.Element element)
Description copied from interface:IClRepositoryObjectInitializes this object with the data stored in the XML element.- Specified by:
initFromXmlin interfaceIClRepositoryObject
-
toXml
public org.w3c.dom.Element toXml(org.w3c.dom.Document document)
Description copied from interface:IXmlPersistenceSupportCreates anElement(using the given document) that represents this object in XML. The caller is responsible of adding the returned element to an otherElementorDocumentif required.- Specified by:
toXmlin interfaceIXmlPersistenceSupport- Parameters:
document- the document to use for creatingElements- Returns:
- an
Elementthat represents this object as XML element
-
getTarget
public T getTarget()
Description copied from interface:IProductComponentLinkReturns the target product component.- Specified by:
getTargetin interfaceIProductComponentLink<T extends IProductComponent>
-
getTargetId
public java.lang.String getTargetId()
Description copied from interface:IProductComponentLinkReturns the target product component's id.- Specified by:
getTargetIdin interfaceIProductComponentLink<T extends IProductComponent>
-
getAssociationName
public java.lang.String getAssociationName()
Description copied from interface:IProductComponentLinkReturns the name of the association this link belongs to.- Specified by:
getAssociationNamein interfaceIProductComponentLink<T extends IProductComponent>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getSource
public IProductComponentLinkSource getSource()
Description copied from interface:IProductComponentLinkReturns theIProductComponentLinkSourcethis link originates from. This may be aIProductComponentGenerationor aIProductComponent(since 3.8).- Specified by:
getSourcein interfaceIProductComponentLink<T extends IProductComponent>
-
-