public final class ExternalLinks
extends java.lang.Object
ExternalLink
objects.
The ReqIF standard contains the SpecRelation
concept to represent relations between SpecObject
objects. Thus, links
between requirements are possible. However, there is currently no way to represent links to elements that are external
to the requirements authoring tool in ReqIF, like links to JIRA issues or UML modeling tool elements.
The convention described in this clause overcomes this restriction. Note that as this is an extension to the capabilities of the ReqIF standard, it may be raised as an issue against a future version of the ReqIF specification. The following table shows the properties that are defined for external links by this convention
Name | Mandatory | Description | Type | Possible Values | Interpretation if Missing |
---|---|---|---|---|---|
SPEC-OBJECT-REF | x | The identifier of the SpecObject that is the source or the target of the external link | Identifier reference, as defined in xsd:IDREF | <Any identifier that is used as identifier of a SpecObject in this ReqIF XML document> | |
LONG-NAME | x | The name of the link | xsd:string | <Any string> | |
URI | x | The identifier of the external item. As one example: the URI of a JIRA issue | URI as defined in xsd:anyURI | <Any URI> | |
DESC | Description of the link, as described by the user of the requirements authoring tool | String as defined in xsd:string | <Any string> | <Empty String>, as user has entered no description | |
LINK-TYPE | The kind of the link, as described by the user of the requirements authoring tool. As one example: verifies for a link between a requirement and a testcase | String as defined in xsd:string. For OSLC links this MUST be the URI of the OSLC link type (see examples). For other link types, this may be any text e.g., verifies. | <Any string> | Nothing specific is said about the link type | |
DIRECTION | Out for links starting at a requirement and ending on an external item. In vice versa. | xsd:enumeration | INWARDS,OUTWARDS | OUTWARDS is default | |
LINK-TECHNOLOGY | The link technology users. Currently only OSLC is supported. | OSLC <Any String> | if missing or <Any String>: tool gets content from URI through protocol in URI, presents it to user |
In ReqIF version 1.0, external links are implemented using the SPEC-OBJECT-EXTENSION
element which is inside a REQ-IF-TOOL-EXTENSION
element
You can obtain the ExternalLinks
collection for each SpecObject
from SpecObject.getExternalLinks()
You can also obtain the collection of SpecObjectReference
objects in a SpecObjectReferences
collection. THis collection
contains references to SpecObject
objects that contain at least one ExternalLink
.
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all
ExternalLink objects from this collection. |
boolean |
contains(ExternalLink externalLink)
Checks whether the specified
ExternalLink exists in this collection. |
ExternalLink |
createExternalLink(java.lang.String desc,
ExternalLinkDirection direction,
java.lang.String linkTechnology,
java.lang.String linkType,
java.lang.String longName,
java.lang.String uri)
Creates a new
ExternalLink objects and adds it to the collection for the owning SpecObject object. |
ExternalLink |
get(int index)
Returns the
ExternalLink object at the specified index that is contained in this collection. |
int |
getCount()
Returns the count of items in this collection.
|
java.util.Iterator<ExternalLink> |
iterator() |
void |
remove(ExternalLink externalLink)
Removes an
ExternalLink from this collection. |
java.util.stream.Stream<ExternalLink> |
stream() |
java.lang.String |
toString() |
public java.util.stream.Stream<ExternalLink> stream()
public java.util.Iterator<ExternalLink> iterator()
iterator
in interface java.lang.Iterable<ExternalLink>
public ExternalLink get(int index) throws java.lang.IndexOutOfBoundsException
ExternalLink
object at the specified index that is contained in this collection.index
- the index of the ExternalLink
to return from the collection, >= 0
and <
collection sizeExternalLink
object at the specified indexjava.lang.IndexOutOfBoundsException
- if the index is < 0
or >=
countpublic boolean contains(ExternalLink externalLink)
ExternalLink
exists in this collection.externalLink
- the ExternalLink
to check, not nulltrue
if the specified externalLink exists
, false
otherwisepublic ExternalLink createExternalLink(java.lang.String desc, ExternalLinkDirection direction, java.lang.String linkTechnology, java.lang.String linkType, java.lang.String longName, java.lang.String uri) throws InvalidValueException
ExternalLink
objects and adds it to the collection for the owning SpecObject
object.desc
- the description, can be nulldirection
- the link direction as a member of the ExternalLinkDirection
enumeration, can be nulllinkTechnology
- the link technology, currently only "OSLC" is supported, can be nulllinkType
- the kind of link e.g., verifies for a link between a requirement and a test case, can be nulllongName
- the name of the link, not null or emptyuri
- the identifier of the link, not null or emptyExternalLink
not nullInvalidValueException
- if any required parameter is null or emptypublic void remove(ExternalLink externalLink) throws NotFoundException
ExternalLink
from this collection.externalLink
- the ExternalLink
object to remove, not nullNotFoundException
- if the specified ExternalLink) is not in the collection
public void clear()
ExternalLink
objects from this collection.public java.lang.String toString()
toString
in class java.lang.Object
public int getCount()