public interface XMLOutputter
Java interface provides the necessary methods to output XML documents in an event-based manner; Consider
the Java classes that implement this interface.
Use the following customizing sequence when outputting XML:
startTag(String) addAttribute(String, String) and the other similar methods to add an attributeaddCharacterData(String) output endTag(String) Caution
Your implementation must apply the sequence order.
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(java.lang.String name,
java.lang.String value)
Adds an attribute of type string to the current XML tag.
|
void |
addBigIntegerAttribute(java.lang.String name,
java.math.BigInteger value)
Adds an attribute of type big integer to the current XML tag.
|
void |
addBooleanAttribute(java.lang.String name,
boolean value)
Adds an attribute of type boolean to the current XML tag.
|
void |
addCharacterData(java.io.Reader data)
Adds character data for the current XML tag.
|
void |
addCharacterData(java.lang.String data)
Adds character data for the current XML tag.
|
void |
addDateAttribute(java.lang.String name,
java.util.Date value)
Adds an attribute of type date to the current XML tag;
Dates are encoded using ISO 8601 format, that is:
'YYYY-MM-DD'.
|
void |
addDateTimeAttribute(java.lang.String name,
java.util.Date value)
Adds an attribute of type date and time to the current XML tag;
Date and times are encoded using ISO 8601 format, that is:
'YYYY-MM-DDTHH:MM:SS.mmm'.
|
void |
addDecimalAttribute(java.lang.String name,
java.math.BigDecimal value)
Adds an attribute of type decimal to the current XML tag.
|
void |
addIntegerAttribute(java.lang.String name,
java.lang.Integer value)
Adds an attribute of type integer to the current XML tag.
|
void |
addLongAttribute(java.lang.String name,
java.lang.Long value)
Adds an attribute of type long to the current XML tag.
|
void |
endTag(java.lang.String tag)
Ends the XML tag.
|
void |
marshal(java.lang.String tagName,
IXMLMarshallable child)
Marshals a node into this writer.
|
void |
startTag(java.lang.String tag)
Starts a XML tag.
|
void startTag(java.lang.String tag)
tag - The name of the XML tag to start withvoid addAttribute(java.lang.String name,
java.lang.String value)
name - The name of the attributevalue - The text value of the attributevoid addDecimalAttribute(java.lang.String name,
java.math.BigDecimal value)
name - The name of the attributevalue - The numerical value of the attributevoid addDateAttribute(java.lang.String name,
java.util.Date value)
name - The name of the attributevalue - The date value of the attributevoid addDateTimeAttribute(java.lang.String name,
java.util.Date value)
name - The name of the attributevalue - The value of the attributevoid addBooleanAttribute(java.lang.String name,
boolean value)
name - The name of the attributevalue - The value of the attributevoid addIntegerAttribute(java.lang.String name,
java.lang.Integer value)
name - The name of the attributevalue - The integer value of the attributevoid addLongAttribute(java.lang.String name,
java.lang.Long value)
name - The name of the attributevalue - The value of the attributevoid addBigIntegerAttribute(java.lang.String name,
java.math.BigInteger value)
name - The name of the attributevalue - The value of the attributevoid addCharacterData(java.lang.String data)
data - The character data to add for the current tagvoid addCharacterData(java.io.Reader data)
data - The character data to add for the current tag as a Readervoid endTag(java.lang.String tag)
tag - The name of the XML tag to closevoid marshal(java.lang.String tagName,
IXMLMarshallable child)
The sequence is:
IXMLMarshallable.marshalAttributes(XMLOutputter)IXMLMarshallable.marshalChildren(XMLOutputter)
Note
This method is taking care of handling a null child.
tagName - The name of child XML tagchild - The child itself, that must be marshalled