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 Closeableclose in interface AutoCloseableclose in class WriterIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class WriterIOExceptionpublic void write(char[] cbuf,
int off,
int len)
throws IOException
write in class WriterIOExceptionpublic void write(Node node, String s) throws IOException
node - s - IOExceptionpublic void writeAttributeValue(Node node, String value, char quoteChar) throws IOException
IOExceptionpublic void writeChildNodes(NodeWithChildren node) throws IOException
IOExceptionpublic void write(Element e) throws IOException
IOExceptionpublic void writeEndElement(Element e) throws IOException
IOExceptionpublic void writeBeginElement(Element e) throws IOException
IOExceptionpublic boolean isCompact(Element e)
public boolean hasSingleTextChild(Element e)
public void indent()
throws IOException
IOExceptionpublic void nl()
throws IOException
IOExceptionpublic void writeAttributes(Element e) throws IOException
IOExceptionpublic void setIndent(String indent)
public String getIndent()
public void setPadCompact(boolean padCompact)
public boolean isPadCompact()
Copyright © 2008–2025. All rights reserved.