| com.sun.xml.txw2.output.XmlSerializer
All known Subclasses: com.sun.xml.txw2.output.StreamSerializer, com.sun.xml.txw2.output.StaxSerializer, com.sun.xml.txw2.output.DomSerializer, com.sun.xml.txw2.output.SaxSerializer, com.sun.xml.txw2.output.DumpSerializer,
XmlSerializer | public interface XmlSerializer (Code) | | Low-level typeless XML writer driven from
TypedXmlWriter .
Applications can use one of the predefined implementations to
send TXW output to the desired location/format, or they can
choose to implement this interface for custom output.
One
XmlSerializer instance is responsible for writing
one XML document.
Call Sequence
TXW calls methods on this interface in the following order:
WHOLE_SEQUENCE := startDocument ELEMENT endDocument
ELEMENT := beginStartTag writeXmlns* writeAttribute* endStartTag CONTENT endTag
CONTENT := (text|ELEMENT)*
TXW maintains all the in-scope namespace bindings and prefix allocation.
The
XmlSerializer implementation should just use the prefix
specified.
author: Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) |
beginStartTag | void beginStartTag(String uri, String localName, String prefix)(Code) | | Begins writing a start tag.
Parameters: uri - the namespace URI of the element. Can be empty but never be null. Parameters: prefix - the prefix that should be used for this element. Can be empty,but never null. |
endDocument | void endDocument()(Code) | | The last method to be called.
|
endStartTag | void endStartTag(String uri, String localName, String prefix)(Code) | | Completes the start tag.
Parameters: uri - the namespace URI of the element. Can be empty but never be null. Parameters: prefix - the prefix that should be used for this element. Can be empty,but never null. |
endTag | void endTag()(Code) | | Writes an end tag.
|
flush | void flush()(Code) | | Flush the buffer.
This method is called when applications invoke
TypedXmlWriter.commit(boolean) method. If the implementation performs any buffering, it should flush the buffer.
|
startDocument | void startDocument()(Code) | | The first method to be called.
|
text | void text(StringBuilder text)(Code) | | Writes PCDATA.
Parameters: text - The character data to be written. It's the callee's responsibility toescape special characters (such as <, >, and &) in this buffer. |
writeAttribute | void writeAttribute(String uri, String localName, String prefix, StringBuilder value)(Code) | | Writes an attribute.
Parameters: value - The value of the attribute. It's the callee's responsibility toescape special characters (such as <, >, and &) in this buffer. Parameters: uri - the namespace URI of the attribute. Can be empty but never be null. Parameters: prefix - the prefix that should be used for this attribute. Can be empty,but never null. |
writeXmlns | void writeXmlns(String prefix, String uri)(Code) | | Writes a namespace declaration.
Parameters: uri - the namespace URI to be declared. Can be empty but never be null. Parameters: prefix - the prefix that is allocated. Can be empty but never be null. |
|
|