public class Detail extends java.lang.Object implements XMLMarshallable
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:simpleType name="detailType">
<xs:restriction base="xs:string">
<xs:enumeration value="decimal"/>
<xs:enumeration value="string"/>
<xs:enumeration value="date"/>
</xs:restriction>
</xs:simpleType><xs:element name="detail">
<xs:complexType>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="detailType"/>
<xs:attribute name="value" type="xs:string"/>
</xs:complexType>
</xs:element>
| Constructor and Description |
|---|
Detail()
Constructs an empty transaction detail.
|
| 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.util.Date |
getDateValue()
Returns the value of the detail; The result is
null if the detail value is not a date. |
java.math.BigDecimal |
getDecimalValue()
Returns the value of the detail.
|
java.lang.String |
getName()
Returns the name of the detail.
|
java.lang.String |
getStringValue()
Returns the value of the detail; The result is
null if the detail value is not a string. |
int |
getType()
|
java.lang.Object |
getValue()
Returns the value of the detail.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
static void |
marshal(XMLOutputter output,
java.lang.String name,
java.lang.Object value)
Helper static method to marshal a detail.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
public java.lang.String getName()
public java.lang.Object getValue()
public java.lang.String getStringValue()
null if the detail value is not a string.public java.util.Date getDateValue()
null if the detail value is not a date.public java.math.BigDecimal getDecimalValue()
null if the detail value is not a decimal.public int getType()
public void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addCharacterData(java.lang.String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void addChild(java.lang.String tagName,
XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object intopublic static void marshal(XMLOutputter output, java.lang.String name, java.lang.Object value)
output - The XML outputter where the output has to goname - The name of the detailvalue - The value of the detail