Package com.highdeal.hci
Interface XMLOutputter
- All Known Implementing Classes:
XMLOutputterWriter,XMLUTF8OutputterWriter
public interface XMLOutputter
This
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)- marshalling of the children through
output endTag(String)
Caution
Your implementation must apply the sequence order.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String name, String value) Adds an attribute of type string to the current XML tag.voidaddBigIntegerAttribute(String name, BigInteger value) Adds an attribute of type big integer to the current XML tag.voidaddBooleanAttribute(String name, boolean value) Adds an attribute of type boolean to the current XML tag.voidaddCharacterData(Reader data) Adds character data for the current XML tag.voidaddCharacterData(String data) Adds character data for the current XML tag.voidaddDateAttribute(String name, 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'.voidaddDateTimeAttribute(String name, 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'.voidaddDecimalAttribute(String name, BigDecimal value) Adds an attribute of type decimal to the current XML tag.voidaddIntegerAttribute(String name, Integer value) Adds an attribute of type integer to the current XML tag.voidaddLongAttribute(String name, Long value) Adds an attribute of type long to the current XML tag.voidEnds the XML tag.voidmarshal(String tagName, IXMLMarshallable child) Marshals a node into this writer.voidStarts a XML tag.
-
Method Details
-
startTag
Starts a XML tag.- Parameters:
tag- The name of the XML tag to start with
-
addAttribute
Adds an attribute of type string to the current XML tag.- Parameters:
name- The name of the attributevalue- The text value of the attribute
-
addDecimalAttribute
Adds an attribute of type decimal to the current XML tag.- Parameters:
name- The name of the attributevalue- The numerical value of the attribute
-
addDateAttribute
Adds an attribute of type date to the current XML tag; Dates are encoded using ISO 8601 format, that is: 'YYYY-MM-DD'.- Parameters:
name- The name of the attributevalue- The date value of the attribute
-
addDateTimeAttribute
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'.- Parameters:
name- The name of the attributevalue- The value of the attribute
-
addBooleanAttribute
Adds an attribute of type boolean to the current XML tag.- Parameters:
name- The name of the attributevalue- The value of the attribute
-
addIntegerAttribute
Adds an attribute of type integer to the current XML tag.- Parameters:
name- The name of the attributevalue- The integer value of the attribute
-
addLongAttribute
Adds an attribute of type long to the current XML tag.- Parameters:
name- The name of the attributevalue- The value of the attribute
-
addBigIntegerAttribute
Adds an attribute of type big integer to the current XML tag.- Parameters:
name- The name of the attributevalue- The value of the attribute
-
addCharacterData
Adds character data for the current XML tag.- Parameters:
data- The character data to add for the current tag
-
addCharacterData
Adds character data for the current XML tag.- Parameters:
data- The character data to add for the current tag as aReader
-
endTag
Ends the XML tag.- Parameters:
tag- The name of the XML tag to close
-
marshal
Marshals a node into this writer.The sequence is:
- Writing the start XML tag
- Writing the attributes
IXMLMarshallable.marshalAttributes(XMLOutputter) - Calling recursively
IXMLMarshallable.marshalChildren(XMLOutputter) - Writing the end XML tag
Note
This method is taking care of handling a
nullchild.- Parameters:
tagName- The name of child XML tagchild- The child itself, that must be marshalled
-