public abstract class AttributeDefinition<T extends AttributeValue> extends Identifiable<AttributeDefinition<T>>
longName inherited from Identifiable is mandatory for all sub classes of AttributeDefinition.
However, this is not reported by the ReqIF xsd validation.
If the isEditable attribute is set to false or left out, no modification
of the default value by tool users is allowed.
Multiple instances of sub classes of this class are maintained in a sub class of the SpecType collection.
AttributeDefinitionBoolean representing the ATTRIBUTE-DEFINITION-BOOLEAN XML elementAttributeDefinitionDate representing the ATTRIBUTE-DEFINITION-DATE XML elementAttributeDefinitionEnumeration representing the ATTRIBUTE-DEFINITION-ENUMERATION XML elementAttributeDefinitionInteger representing the ATTRIBUTE-DEFINITION-INTEGER XML elementAttributeDefinitionReal representing the ATTRIBUTE-DEFINITION-REAL XML elementAttributeDefinitionString representing the ATTRIBUTE-DEFINITION-STRING XML elementAttributeDefinitionXHTML representing the ATTRIBUTE-DEFINITION-XHTML XML elementThe general form of an AttributeDefinition in a ReqIF file is as follows:
<ATTRIBUTE-DEFINITION-XXXX DESC="desc" IS-EDITABLE="isEditable" IDENTIFIER="identifier" LAST-CHANGE="lastChange" LONG-NAME="longName">
The following is the common list of XML attributes:
@DESC optional xsd:string description@IS-EDITABLE optional xsd:boolean, if not specified, false is assumed@IDENTIFIER required xsd:ID@LAST-CHANGE required xsd:dateTime@LONG-NAME required xsd:string (Note: currently the reqif.xsd does not enforce this)Refer to each individual superclass for more information about specific extensions to the general form.
| Modifier and Type | Method and Description |
|---|---|
DatatypeDefinition |
getDatatypeDefinition()
Returns the
DatatypeDefinition base class instance associated with this AttributeDefinition. |
abstract T |
getDefaultValue()
The default value which can be assigned by the exporting tool if one is specified.
|
SpecType |
getSpecType()
Returns the
SpecType base class instance owning this AttributeDefinition |
boolean |
hasDefaultValue() |
boolean |
isEditable()
Returns the value of the
@IS-EDITABLE attribute for this AttributeDefinition. |
void |
removeDefaultValue()
Removes the default value if one is set.
|
void |
setIsEditable(boolean isEditable)
Sets the
@IS-EDITABLE attribute for this AttributeDefinition subclass. |
java.lang.String |
toString()
Returns the string representation for this
AttributeDefinition. |
equals, getAlternativeID, getChildren, getDesc, getIdentifier, getLastChange, getLastChangeText, getLongName, getPathToRoot, getReqIFContent, hashCode, isUsed, isValidIdentifier, setAlternativeID, setDesc, setLastChange, setLongName, whereUsedpublic abstract T getDefaultValue()
If, during import, an AttributeValue is not specified for a particular SpecElementWithAttributes,
and corresponding AttributeDefinition on the associated SpecType, then the default value if one
exists will be the substitute for the missing value otherwise the value null is assumed meaning 'unset'.
AttributeDefinitionpublic boolean hasDefaultValue()
true or false depending on whether this AttributeDefinition has a default value assignedpublic SpecType getSpecType()
SpecType base class instance owning this AttributeDefinitionSpecType of this AttributeDefinitionpublic DatatypeDefinition getDatatypeDefinition()
DatatypeDefinition base class instance associated with this AttributeDefinition.
Each AttributeDefinition subclass will contain a specialized version of this method returning the
appropriate subclass of DatatypeDefinition.
DatatypeDefinition associated with this AttributeDefinitionpublic boolean isEditable()
@IS-EDITABLE attribute for this AttributeDefinition. If the @IS-EDITABLE
attribute is not specified in the ReqIF, the value false is assumed.@IS-EDITABLE attribute for this AttributeDefinition.public java.lang.String toString()
AttributeDefinition.toString in class java.lang.ObjectAttributeDefinitionpublic void setIsEditable(boolean isEditable)
@IS-EDITABLE attribute for this AttributeDefinition subclass.isEditable - true to enable editing or false to disable editingpublic void removeDefaultValue()
throws NotFoundException
NotFoundException - if this AttributeDefinition has been removed from its SpecType SpecAttributes collection