public final class AttributeDefinitionEnumeration extends AttributeDefinition<AttributeValueEnumeration>
Attributes
true
, this means that the user of a requirements authoring tool can pick one or more than one of the values in the set of specified values as an enumeration attribute value.false
, this means that the user of a requirements authoring tool can pick exactly one of the values in the set of specified values as an enumeration attribute value.Associations
If the isEditable
attribute is set to false or left out, no modification
of the default value by tool users is allowed.
Constraints
If the inherited isEditable
attribute is set to false or left out, all of the following constraints apply:
Semantics
There are basically two kinds of enumerations: "single-choice" and "multiple-choice" enumerations.
For "multiple-choice" enumerations, the multiValued attribute needs to be set to true
, for "single-choice"
enumerations it needs to be set to false
.
This class extends from the base class AttributeDefinition
.
The specific form of an AttributeDefinitionEnumeration
in a ReqIF file is as follows:
<ATTRIBUTE-DEFINITION-ENUMERATION DESC="desc" IS-EDITABLE="isEditable" IDENTIFIER="identifier" LAST-CHANGE="lastChange" LONG-NAME="longName" MULTI-VALUED="multiValued">
The following is the 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)@MULTI-VALUED
required xsd:boolean
see aboveModifier and Type | Method and Description |
---|---|
DatatypeDefinitionEnumeration |
getDatatypeDefinitionEnumeration()
Type specific getter for the associated
DatatypeDefinition subclass. |
AttributeValueEnumeration |
getDefaultValue()
The default value which can be assigned by the exporting tool if one is specified.
|
boolean |
getMultiValued() |
void |
setDefaultValue(EnumValue... theValues)
Sets the default values for this object using a
List . |
void |
setMultiValued(boolean multiValued)
Sets the value of the
@MULTI-VALUED attribute of this AttributeDefinitionEnumeration object. |
getDatatypeDefinition, getSpecType, hasDefaultValue, isEditable, removeDefaultValue, setIsEditable, toString
equals, getAlternativeID, getChildren, getDesc, getIdentifier, getLastChange, getLastChangeText, getLongName, getPathToRoot, getReqIFContent, hashCode, isUsed, isValidIdentifier, setAlternativeID, setDesc, setLastChange, setLongName, whereUsed
public boolean getMultiValued()
@MULTI-VALUED
attribute of this AttributeDefinitionEnumeration
objectpublic void setMultiValued(boolean multiValued) throws InvalidValueException, NotFoundException
@MULTI-VALUED
attribute of this AttributeDefinitionEnumeration
object.multiValued
- true
to set the @MULTI-VALUED
attribute or false
to unset the attribute.InvalidValueException
- if an attempt is made to clear the flag when there are existing AttributeDefinitionEnumeration
or AttributeValueEnumeration
objects that have more multiple EnumValue
references.NotFoundException
- is this AttributeDefinitionEnumeration
has been removed from the SpecType
SpecAttributes
collectionpublic DatatypeDefinitionEnumeration getDatatypeDefinitionEnumeration()
DatatypeDefinition
subclass.DatatypeDefinitionEnumeration
object, not nullpublic AttributeValueEnumeration getDefaultValue()
If, during import, an AttributeValueEnumeration
is not specified for a particular SpecElementWithAttributes
,
and corresponding AttributeDefinitionEnumeration
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'.
getDefaultValue
in class AttributeDefinition<AttributeValueEnumeration>
AttributeDefinitionEnumeration
public void setDefaultValue(EnumValue... theValues) throws InvalidValueException, NotFoundException
List
.
See AttributeDefinition.removeDefaultValue()
to unset the default.
theValues
- the Array
containing instances of EnumValue
objects to set as the default, not nullInvalidValueException
- if the specified parameter is null, or any of the objects in the list are null or any
of the objects in the list are not contained in the associated DatatypeDefinitionEnumeration
or more than one
EnumValue
object is specified when the @MULTI-VALUED
attribute is false
NotFoundException
- if this AttributeDefinitionEnumeration
has been removed from its SpecType