public class XmlWriter extends java.lang.Object implements java.io.Closeable
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<java.lang.Character,java.lang.String> |
encoding
The output writer to save the values to.
|
protected java.io.PrintWriter |
out |
Constructor and Description |
---|
XmlWriter(java.io.PrintWriter out)
Constructs a new
XmlWriter . |
Modifier and Type | Method and Description |
---|---|
void |
close() |
static java.lang.String |
encode(java.lang.String unencoded)
Encode the given string in XML1.0 format.
|
static java.lang.String |
encode(java.lang.String unencoded,
boolean keepApos)
Encode the given string in XML1.0 format.
|
void |
flush()
Flushes the stream.
|
protected final java.io.PrintWriter out
private static final java.util.Map<java.lang.Character,java.lang.String> encoding
public XmlWriter(java.io.PrintWriter out)
XmlWriter
.out
- print writerpublic void flush()
public static java.lang.String encode(java.lang.String unencoded)
unencoded
- the unencoded input stringpublic static java.lang.String encode(java.lang.String unencoded, boolean keepApos)
unencoded
- the unencoded input stringkeepApos
- true if apostrophe sign should stay as it is (in order to work around
a Java bug that renders
new JLabel("<html>'</html>")
literally as 6 character string, see #7558)public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException