- java.lang.Object
-
- com.sun.xml.txw2.output.DumpSerializer
-
- All Implemented Interfaces:
XmlSerializer
public class DumpSerializer extends Object implements XmlSerializer
Shows the call sequence ofXmlSerializermethods. Useful for debugging and learning how TXW works.- Author:
- Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
-
-
Constructor Summary
Constructors Constructor Description DumpSerializer(PrintStream out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginStartTag(String uri, String localName, String prefix)Begins writing a start tag.voidcdata(StringBuilder text)Writes CDATA.voidcomment(StringBuilder comment)Writes a comment.voidendDocument()The last method to be called.voidendStartTag(String uri, String localName, String prefix)Completes the start tag.voidendTag()Writes an end tag.voidflush()Flush the buffer.voidstartDocument()The first method to be called.voidtext(StringBuilder text)Writes PCDATA.voidwriteAttribute(String uri, String localName, String prefix, StringBuilder value)Writes an attribute.voidwriteXmlns(String prefix, String uri)Writes a namespace declaration.
-
-
-
Constructor Detail
-
DumpSerializer
public DumpSerializer(PrintStream out)
-
-
Method Detail
-
beginStartTag
public void beginStartTag(String uri, String localName, String prefix)
Description copied from interface:XmlSerializerBegins writing a start tag.- Specified by:
beginStartTagin interfaceXmlSerializer- Parameters:
uri- the namespace URI of the element. Can be empty but never be null.prefix- the prefix that should be used for this element. Can be empty, but never null.
-
writeAttribute
public void writeAttribute(String uri, String localName, String prefix, StringBuilder value)
Description copied from interface:XmlSerializerWrites an attribute.- Specified by:
writeAttributein interfaceXmlSerializer- Parameters:
uri- the namespace URI of the attribute. Can be empty but never be null.prefix- the prefix that should be used for this attribute. Can be empty, but never null.value- The value of the attribute. It's the callee's responsibility to escape special characters (such as <, >, and &) in this buffer.
-
writeXmlns
public void writeXmlns(String prefix, String uri)
Description copied from interface:XmlSerializerWrites a namespace declaration.- Specified by:
writeXmlnsin interfaceXmlSerializer- Parameters:
prefix- the prefix that is allocated. Can be empty but never be null.uri- the namespace URI to be declared. Can be empty but never be null.
-
endStartTag
public void endStartTag(String uri, String localName, String prefix)
Description copied from interface:XmlSerializerCompletes the start tag.- Specified by:
endStartTagin interfaceXmlSerializer- Parameters:
uri- the namespace URI of the element. Can be empty but never be null.prefix- the prefix that should be used for this element. Can be empty, but never null.
-
endTag
public void endTag()
Description copied from interface:XmlSerializerWrites an end tag.- Specified by:
endTagin interfaceXmlSerializer
-
text
public void text(StringBuilder text)
Description copied from interface:XmlSerializerWrites PCDATA.- Specified by:
textin interfaceXmlSerializer- Parameters:
text- The character data to be written. It's the callee's responsibility to escape special characters (such as <, >, and &) in this buffer.
-
cdata
public void cdata(StringBuilder text)
Description copied from interface:XmlSerializerWrites CDATA.- Specified by:
cdatain interfaceXmlSerializer
-
comment
public void comment(StringBuilder comment)
Description copied from interface:XmlSerializerWrites a comment.- Specified by:
commentin interfaceXmlSerializer
-
startDocument
public void startDocument()
Description copied from interface:XmlSerializerThe first method to be called.- Specified by:
startDocumentin interfaceXmlSerializer
-
endDocument
public void endDocument()
Description copied from interface:XmlSerializerThe last method to be called.- Specified by:
endDocumentin interfaceXmlSerializer
-
flush
public void flush()
Description copied from interface:XmlSerializerFlush the buffer. This method is called when applications invokeTypedXmlWriter.commit(boolean)method. If the implementation performs any buffering, it should flush the buffer.- Specified by:
flushin interfaceXmlSerializer
-
-