public class Attribute extends HCIModelAdapter
Java class represents an attribute of an object which contains a name, a type (boolean, number, string, or date) and an optional value.AttributeSetThe XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="attribute">
<xs:complexType>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="AttributeValueType"/>
<xs:attribute name="value" type="xs:string"/>
</xs:complexType>
</xs:element><xs:simpleType name="AttributeValueType">
<xs:restriction base="xs:string">
<xs:enumeration value="boolean"/>
<xs:enumeration value="number"/>
<xs:enumeration value="string"/>
<xs:enumeration value="date"/>
</xs:restriction>
</xs:simpleType>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TAG_NAME
The XML element name of the data element: attribute
|
| Constructor and Description |
|---|
Attribute()
Build an empty attribute
|
Attribute(java.lang.String name,
int type,
java.lang.Object value)
Build an attribute with a name, a type and a valid value.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(java.lang.String cData)
Adds character data to the content element.
|
void |
addChild(java.lang.String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
java.lang.String |
getName()
Gets the name of the attribute.
|
java.lang.String |
getTagName()
Gets the XML tag name of the HCI model.
|
int |
getType()
|
java.lang.Object |
getValue()
Gets the value of the attribute.
|
void |
marshalAttributes(XMLOutputter output)
Gives an XML representation of the attributes of an object.
|
void |
marshalChildren(XMLOutputter output)
Gives an XML representation of the child objects of an object.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
marshalpublic static final java.lang.String TAG_NAME
public Attribute()
public Attribute(java.lang.String name,
int type,
java.lang.Object value)
The value of the attribute must be a valid object class according to the attribute type:
name - The name of the attributetype - The type of the attributevalue - The value of the attributepublic java.lang.String getName()
public int getType()
public java.lang.Object getValue()
public void marshalAttributes(XMLOutputter output)
IXMLMarshallableoutput - The XML output to marshal the object attributes intopublic void marshalChildren(XMLOutputter output)
IXMLMarshallableoutput - The XML output to marshal the child objects intopublic void setAttributes(XMLAttributes atts)
XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(java.lang.String tagName,
XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.tagName - The name of tag for the childchild - The child to be addedpublic void addCharacterData(java.lang.String cData)
XMLMarshallablecData - The character data to be addedpublic java.lang.String getTagName()
ITagNameProvider