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
CardinalityRange class.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates 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.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, 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, String associationName) Creates a new link with the cardinality and association name to the given target for the given product component/generation. -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the association this link belongs to.Returns theIProductComponentLinkSourcethis link originates from.Returns the target product component.Returns the target product component's id.voidinitFromXml(Element element) Initializes this object with the data stored in the XML element.toString()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, writeExtensionPropertiesToXmlMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.faktorips.runtime.IRuntimeObject
getExtensionPropertyIds, getExtensionPropertyValue
-
Constructor Details
-
ProductComponentLink
Creates a new link for the given product component generation. Target and cardinality must be set by invokinginitFromXml. -
ProductComponentLink
Creates a new link to the given target for the given product component generation using the cardinality (0,*).- Throws:
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:
NullPointerException- if any of the parameters isnull.
-
ProductComponentLink
Creates a new link for the given product component/generation. Target and cardinality must be set by invokinginitFromXml. -
ProductComponentLink
Creates a new link to the given target for the given product component/generation using the cardinality (0,*).- Throws:
NullPointerException- if any of the parameters isnull.
-
ProductComponentLink
Creates a new link to the given target and association name for the given product component/generation using the cardinality (0,*).- Throws:
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:
NullPointerException- if any of the parameters isnull.
-
ProductComponentLink
public ProductComponentLink(IProductComponentLinkSource source, T target, CardinalityRange cardinality, String associationName) Creates a new link with the cardinality and association name to the given target for the given product component/generation.- Throws:
NullPointerException- if any of the parameters isnull.
-
-
Method Details
-
getCardinality
- Specified by:
getCardinalityin interfaceIProductComponentLink<T extends IProductComponent>- Returns:
- this link's min and max cardinality as a
IntegerRange.
-
initFromXml
Description copied from interface:IClRepositoryObjectInitializes this object with the data stored in the XML element.- Specified by:
initFromXmlin interfaceIClRepositoryObject
-
toXml
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
Description copied from interface:IProductComponentLinkReturns the target product component.- Specified by:
getTargetin interfaceIProductComponentLink<T extends IProductComponent>
-
getTargetId
Description copied from interface:IProductComponentLinkReturns the target product component's id.- Specified by:
getTargetIdin interfaceIProductComponentLink<T extends IProductComponent>
-
getAssociationName
Description copied from interface:IProductComponentLinkReturns the name of the association this link belongs to.- Specified by:
getAssociationNamein interfaceIProductComponentLink<T extends IProductComponent>
-
toString
-
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>
-