public class XMLWriter extends Writer
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
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(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,
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,
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
|
protected Node current
public XMLWriter(Writer writer)
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Writer
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
public void write(char[] cbuf, int off, int len) throws IOException
write
in class Writer
IOException
public void write(Node node, String s) throws IOException
node
- s
- IOException
public void writeAttributeValue(Node node, String value, char quoteChar) throws IOException
IOException
public void writeChildNodes(NodeWithChildren node) throws IOException
IOException
public void write(Element e) throws IOException
IOException
public void writeEndElement(Element e) throws IOException
IOException
public void writeBeginElement(Element e) throws IOException
IOException
public boolean isCompact(Element e)
public boolean hasSingleTextChild(Element e)
public void indent() throws IOException
IOException
public void nl() throws IOException
IOException
public void writeAttributes(Element e) throws IOException
IOException
public void setIndent(String indent)
public String getIndent()
public void setPadCompact(boolean padCompact)
public boolean isPadCompact()
Copyright © 2008–2021. All rights reserved.