public class XMLWriter
extends java.io.Writer
| Modifier and Type | Field and Description |
|---|---|
protected Node |
current |
private java.lang.String |
indent |
private int |
level |
private boolean |
padCompact |
private java.io.Writer |
writer |
| Constructor and Description |
|---|
XMLWriter(java.io.Writer writer) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
java.lang.String |
getIndent() |
boolean |
hasSingleTextChild(Element e) |
void |
indent() |
boolean |
isCompact(Element e) |
boolean |
isPadCompact()
If this is true, the writer makes sure that there is a single space before "/>"
|
void |
nl() |
void |
setIndent(java.lang.String indent) |
void |
setPadCompact(boolean padCompact) |
void |
write(char[] cbuf,
int off,
int len) |
void |
write(Element e)
Write an element with all attributes and children
|
void |
write(Node node,
java.lang.String s)
If you want to see every node written to the underlying writer, this is the place.
|
void |
writeAttributes(Element e) |
void |
writeAttributeValue(Node node,
java.lang.String value,
char quoteChar) |
void |
writeBeginElement(Element e)
Write the start tag of an element including the attributes.
|
void |
writeChildNodes(NodeWithChildren node)
Write all children of a node
|
void |
writeEndElement(Element e)
Write the end tag of an element
|
private final java.io.Writer writer
protected Node current
private java.lang.String indent
private int level
private boolean padCompact
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Writerjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOExceptionpublic void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void write(Node node, java.lang.String s) throws java.io.IOException
node - s - java.io.IOExceptionpublic void writeAttributeValue(Node node, java.lang.String value, char quoteChar) throws java.io.IOException
java.io.IOExceptionpublic void writeChildNodes(NodeWithChildren node) throws java.io.IOException
java.io.IOExceptionpublic void write(Element e) throws java.io.IOException
java.io.IOExceptionpublic void writeEndElement(Element e) throws java.io.IOException
java.io.IOExceptionpublic void writeBeginElement(Element e) throws java.io.IOException
java.io.IOExceptionpublic boolean isCompact(Element e)
public boolean hasSingleTextChild(Element e)
public void indent()
throws java.io.IOException
java.io.IOExceptionpublic void nl()
throws java.io.IOException
java.io.IOExceptionpublic void writeAttributes(Element e) throws java.io.IOException
java.io.IOExceptionpublic void setIndent(java.lang.String indent)
public java.lang.String getIndent()
public void setPadCompact(boolean padCompact)
public boolean isPadCompact()