java.lang.Object | ||
↳ | com.thoughtworks.xstream.io.xml.AbstractXmlWriter | |
↳ | com.thoughtworks.xstream.io.xml.PrettyPrintWriter |
Known Direct Subclasses |
A simple writer that outputs XML in a pretty-printed indented stream.
By default, the chars
are escaped and replaced with a suitable XML entity. To alter this behavior, override
the the
& < > " ' \r
writeText(com.thoughtworks.xstream.core.util.QuickWriter, String)
and
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).
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
XML_1_0 | |||||||||||
XML_1_1 | |||||||||||
XML_QUIRKS | |||||||||||
depth |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This constructor is deprecated.
since 1.3
| |||||||||||
This constructor is deprecated.
since 1.3
| |||||||||||
This constructor is deprecated.
since 1.3
| |||||||||||
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.thoughtworks.xstream.io.xml.AbstractXmlWriter
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.thoughtworks.xstream.io.ExtendedHierarchicalStreamWriter
| |||||||||||
From interface
com.thoughtworks.xstream.io.HierarchicalStreamWriter
| |||||||||||
From interface
com.thoughtworks.xstream.io.xml.XmlFriendlyWriter
|
This constructor is deprecated.
since 1.3
This constructor is deprecated.
since 1.3
This constructor is deprecated.
since 1.3