public abstract class Identifiable<T extends Identifiable<?>>
extends java.lang.Object
The Identifiable element provides globally unique and lifetime immutable identity to ReqIF elements. In addition, Identifiable provides change tracking for the derived ReqIF element, and provides for an optional human-readable name and an optional textual description for the derived ReqIF element.
While the longName attribute is optional from the viewpoint of Identifiable, some ReqIF elements make this long name mandatory. This fact is stated in the class description of the affected elements.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAlternativeID()
The linkage to the optional alternative identification element.
|
Children |
getChildren()
Where this
Identifable is the base class for Specification or SpecHierarchy , this member
contains the child SpecHierarchy objects. |
java.lang.String |
getDesc()
Optional additional description for the information element.
|
java.lang.String |
getIdentifier()
The lifetime immutable identifier for an instance of a ReqIF information type.
|
java.util.Date |
getLastChange()
The date and time of the last change of the information element.
|
java.lang.String |
getLastChangeText()
The date and time of the last change of the information element as a
String . |
java.lang.String |
getLongName()
The human-readable name for the information element.
|
java.lang.String |
getPathToRoot()
Helper function returning the path to the XML root for display in validation messages.
|
ReqIFContent |
getReqIFContent()
Reference to the owning
ReqIFContent object. |
int |
hashCode() |
boolean |
isUsed() |
static boolean |
isValidIdentifier(java.lang.String identifier)
Checks whether the supplied String identifier is valid XSD:ID.
|
void |
setAlternativeID(java.lang.String identifier)
Sets the
ALTERNATIVE-ID[@IDENTIFIER] attribute to the specified value. |
void |
setDesc(java.lang.String desc)
Sets the
@DESC attribute to the specified value. |
void |
setLastChange(java.util.Date lastChange)
Sets the date/time of the last change of the information element.
|
void |
setLongName(java.lang.String longName)
Sets the human-readable name for the information.
|
Identifiables |
whereUsed() |
public java.lang.String getAlternativeID()
String
value of the ALTERNATIVE-ID
element @IDENTIFIER
attribute, can be null but not emptypublic void setAlternativeID(java.lang.String identifier)
ALTERNATIVE-ID[@IDENTIFIER]
attribute to the specified value.identifier
- the value to set as the ALTERNATIVE-ID
identifierpublic java.lang.String getIdentifier()
The value of the identifier must be a well-formed xsd:ID and must be globally unique.
@IDENTIFIER
XML attribute, not null and uniquepublic java.lang.String getDesc()
@DESC
XML attribute, can be nullpublic void setDesc(java.lang.String desc)
@DESC
attribute to the specified value.desc
- the value to set as the @DESC
attribute, can be nullpublic java.util.Date getLastChange()
This includes the creation of the information element. lastChange is of the XML Schema data type "dateTime" that specifies the time format as CCYY-MM-DDThh:mm:ss with optional time zone indicator as a suffix ±hh:mm.
Date
corresponding to the @LAST-CHANGE
XML attribute, not nullpublic void setLastChange(java.util.Date lastChange)
LAST-CHANGE
attribute.lastChange
- the Date
value to set for the @DESC
attribute, not nullpublic java.lang.String getLastChangeText()
String
. Where the ReqIF was loaded from a file,
the representation is exactly as defined in the XML file. Where the time is set using setLastChange(java.util.Date)
or in the
constructor, the representation is determined from the Date
.
This includes the creation of the information element. lastChange is of the XML Schema data type "dateTime" that specifies the time format as CCYY-MM-DDThh:mm:ss with optional time zone indicator as a suffix ±hh:mm.
Date
corresponding to the @LAST-CHANGE
XML attribute as a String, not null and not emptypublic java.lang.String getLongName()
String
corresponding to the @LONG-NAME
XML attribute, can be null except for AttributeDefinition
objectspublic void setLongName(java.lang.String longName)
@LONG-NAME
attribute.longName
- the value to set for the @LONG-NAME
attribute, can be nullpublic ReqIFContent getReqIFContent()
ReqIFContent
object.ReqIFContent
object, not nullpublic Identifiables whereUsed()
public boolean isUsed()
true
if this Identifiable
is referenced by any other object, false
otherwisepublic static boolean isValidIdentifier(java.lang.String identifier)
The type xsd:ID is used for an attribute that uniquely identifies an element in an XML document. An xsd:ID value must be an NCName. This means that it must start with a letter or underscore, and can only contain letters, digits, underscores, hyphens, and periods.
identifier
- the identifier to check, can be nullpublic Children getChildren()
Identifable
is the base class for Specification
or SpecHierarchy
, this member
contains the child SpecHierarchy
objects. Otherwise it is null.Children
of this object when it is a Specification
or SpecHierarchy
, can be nullpublic java.lang.String getPathToRoot()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object