| java.lang.Object com.thoughtworks.xstream.io.xml.AbstractXmlWriter com.thoughtworks.xstream.io.xml.PrettyPrintWriter
All known Subclasses: com.thoughtworks.xstream.io.xml.CompactWriter,
PrettyPrintWriter | public class PrettyPrintWriter extends AbstractXmlWriter (Code) | | A simple writer that outputs XML in a pretty-printed indented stream.
By default, the chars
& < > " ' \r
are escaped and replaced with a suitable XML entity. To alter this behavior, override
the the
PrettyPrintWriter.writeText(com.thoughtworks.xstream.core.util.QuickWriter,String) and
PrettyPrintWriter.writeAttributeValue(com.thoughtworks.xstream.core.util.QuickWriter,String) methods.
Note: Depending on the XML version some characters cannot be written. Especially a 0
character is never valid in XML, neither directly nor as entity nor within CDATA. However, this writer
works by default in a quirks mode, where it will write any character at least as character entity (even
a null character). You may switch into XML_1_1 mode (which supports most characters) or XML_1_0
that does only support a very limited number of control characters. See XML specification for version
1.0 or
1.1. If a character is
not supported, a
StreamException is thrown. Select a proper parser implementation that
respects the version in the XML header (the Xpp3 parser will also read character entities of normally
invalid characters).
author: Joe Walnes author: Jörg Schaible |
Constructor Summary | |
public | PrettyPrintWriter(Writer writer, char[] lineIndenter, String newLine, XmlFriendlyReplacer replacer) | public | PrettyPrintWriter(Writer writer, int mode, char[] lineIndenter, XmlFriendlyReplacer replacer) | public | PrettyPrintWriter(Writer writer, char[] lineIndenter, String newLine) | public | PrettyPrintWriter(Writer writer, int mode, char[] lineIndenter) | public | PrettyPrintWriter(Writer writer, char[] lineIndenter) | public | PrettyPrintWriter(Writer writer, String lineIndenter, String newLine) | public | PrettyPrintWriter(Writer writer, int mode, String lineIndenter) | public | PrettyPrintWriter(Writer writer, String lineIndenter) | public | PrettyPrintWriter(Writer writer, int mode, XmlFriendlyReplacer replacer) | public | PrettyPrintWriter(Writer writer, XmlFriendlyReplacer replacer) | public | PrettyPrintWriter(Writer writer, int mode) | public | PrettyPrintWriter(Writer writer) |
XML_1_0 | public static int XML_1_0(Code) | | |
XML_1_1 | public static int XML_1_1(Code) | | |
XML_QUIRKS | public static int XML_QUIRKS(Code) | | |
depth | protected int depth(Code) | | |
PrettyPrintWriter | public PrettyPrintWriter(Writer writer, char[] lineIndenter, String newLine)(Code) | | |
PrettyPrintWriter | public PrettyPrintWriter(Writer writer, int mode, char[] lineIndenter)(Code) | | since: 1.3 |
PrettyPrintWriter | public PrettyPrintWriter(Writer writer, char[] lineIndenter)(Code) | | |
PrettyPrintWriter | public PrettyPrintWriter(Writer writer, int mode, String lineIndenter)(Code) | | since: 1.3 |
PrettyPrintWriter | public PrettyPrintWriter(Writer writer, int mode)(Code) | | since: 1.3 |
PrettyPrintWriter | public PrettyPrintWriter(Writer writer)(Code) | | |
close | public void close()(Code) | | |
endNode | public void endNode()(Code) | | |
endOfLine | protected void endOfLine()(Code) | | |
flush | public void flush()(Code) | | |
|
|