java.io.Closeable, java.io.Flushable, java.lang.AutoCloseablepublic class XmlDataWriter
extends java.lang.Object
implements java.io.Closeable, java.io.Flushable
| Modifier and Type | Field | Description |
|---|---|---|
protected static org.apache.logging.log4j.Logger |
LOGGER |
| Constructor | Description |
|---|---|
XmlDataWriter(XmlWriter writer) |
|
XmlDataWriter(java.io.File file) |
|
XmlDataWriter(java.io.File file,
cdc.util.compress.Compressor compressor) |
|
XmlDataWriter(java.io.File file,
java.lang.String encoding) |
|
XmlDataWriter(java.io.File file,
java.lang.String encoding,
cdc.util.compress.Compressor compressor) |
|
XmlDataWriter(java.io.OutputStream os) |
|
XmlDataWriter(java.io.OutputStream os,
java.lang.String encoding) |
|
XmlDataWriter(java.io.PrintStream out) |
|
XmlDataWriter(java.io.PrintStream out,
java.lang.String encoding) |
|
XmlDataWriter(java.io.Writer writer) |
|
XmlDataWriter(java.lang.String filename) |
|
XmlDataWriter(java.lang.String filename,
cdc.util.compress.Compressor compressor) |
|
XmlDataWriter(java.lang.String filename,
java.lang.String encoding) |
|
XmlDataWriter(java.lang.String filename,
java.lang.String encoding,
cdc.util.compress.Compressor compressor) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
void |
flush() |
|
XmlWriter |
getXmlWriter() |
|
static void |
print(Document doc,
java.io.PrintStream out,
java.lang.String indent,
boolean close,
XmlWriter.Feature... features) |
Prints a Document to a PrintStream.
|
static void |
print(Node node,
boolean asDocument,
java.io.PrintStream out,
java.lang.String indent,
boolean close,
XmlWriter.Feature... features) |
Prints a Node to a PrintStream.
|
static void |
save(Document doc,
java.io.File file,
java.lang.String indent,
XmlWriter.Feature... features) |
Saves a Document to a File.
|
static void |
save(Document doc,
java.io.OutputStream os,
java.lang.String indent,
XmlWriter.Feature... features) |
Saves a Document to an OutputStream.
|
static void |
save(Document doc,
java.io.Writer writer,
java.lang.String indent,
XmlWriter.Feature... features) |
Saves a Document to a Writer.
|
static void |
save(Document doc,
java.lang.String filename,
java.lang.String indent,
XmlWriter.Feature... features) |
Saves a Document to a File.
|
static void |
save(Node node,
boolean asDocument,
java.io.File file,
java.lang.String indent,
XmlWriter.Feature... features) |
Saves a Node to a File.
|
static void |
save(Node node,
boolean asDocument,
java.io.OutputStream os,
java.lang.String indent,
XmlWriter.Feature... features) |
Saves a Node to an OutputStream.
|
static void |
save(Node node,
boolean asDocument,
java.io.Writer writer,
java.lang.String indent,
XmlWriter.Feature... features) |
Saves a Node to a Writer.
|
static void |
save(Node node,
boolean asDocument,
java.lang.String filename,
java.lang.String indent,
XmlWriter.Feature... features) |
Saves a Node to a File.
|
static java.lang.String |
toString(Document doc,
java.lang.String indent,
XmlWriter.Feature... features) |
|
static java.lang.String |
toString(Node node,
boolean asDocument,
java.lang.String indent,
XmlWriter.Feature... features) |
|
void |
write(Node node) |
Writes a node.
|
static void |
write(XmlWriter writer,
Node node) |
Writes a node to an XmlWriter.
|
static void |
write(XmlWriter writer,
Node node,
boolean asDocument) |
Writes a node to an XmlWriter.
|
public XmlDataWriter(XmlWriter writer)
public XmlDataWriter(java.io.Writer writer)
public XmlDataWriter(java.io.OutputStream os)
throws java.io.IOException
java.io.IOExceptionpublic XmlDataWriter(java.io.OutputStream os,
java.lang.String encoding)
throws java.io.IOException
java.io.IOExceptionpublic XmlDataWriter(java.io.PrintStream out)
throws java.io.IOException
java.io.IOExceptionpublic XmlDataWriter(java.io.PrintStream out,
java.lang.String encoding)
throws java.io.IOException
java.io.IOExceptionpublic XmlDataWriter(java.lang.String filename,
java.lang.String encoding,
cdc.util.compress.Compressor compressor)
throws java.io.IOException
java.io.IOExceptionpublic XmlDataWriter(java.lang.String filename,
java.lang.String encoding)
throws java.io.IOException
java.io.IOExceptionpublic XmlDataWriter(java.lang.String filename,
cdc.util.compress.Compressor compressor)
throws java.io.IOException
java.io.IOExceptionpublic XmlDataWriter(java.lang.String filename)
throws java.io.IOException
java.io.IOExceptionpublic XmlDataWriter(java.io.File file,
java.lang.String encoding,
cdc.util.compress.Compressor compressor)
throws java.io.IOException
java.io.IOExceptionpublic XmlDataWriter(java.io.File file,
java.lang.String encoding)
throws java.io.IOException
java.io.IOExceptionpublic XmlDataWriter(java.io.File file,
cdc.util.compress.Compressor compressor)
throws java.io.IOException
java.io.IOExceptionpublic XmlDataWriter(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic final XmlWriter getXmlWriter()
public void write(Node node) throws java.io.IOException
node - The node.java.io.IOException - When an IO error occurs.public static void write(XmlWriter writer, Node node, boolean asDocument) throws java.io.IOException
writer - The XmlWriter.node - The node.asDocument - If true and node is not a document, inserts
XML heading <?xml version="1.0" encoding="UTF-8"?> before writing
the node.false and node is not a document, directly writes the node.node is a document, this has no effect.java.io.IOException - When an IO error occurs.public static void write(XmlWriter writer, Node node) throws java.io.IOException
If node is not a document, XML heading <?xml version="1.0" encoding="UTF-8"?>
is not inserted.
Use write(XmlWriter, Node, boolean) for that.
writer - The XmlWriter.node - The node.java.io.IOException - When an IO error occurs.public void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushablejava.io.IOExceptionpublic static void print(Node node, boolean asDocument, java.io.PrintStream out, java.lang.String indent, boolean close, XmlWriter.Feature... features) throws java.io.IOException
node - The node.asDocument - If true and node is not a document, inserts
XML heading <?xml version="1.0" encoding="UTF-8"?> before writing
the node.false and node is not a document, directly writes the node.node is a document, this has no effect.out - The PrintStream.indent - Indent string. If not null, pretty printing is enabled.close - If true, out is closed in the end.features - The XmlWriter features to enable.java.io.IOException - When an IO error occurs.public static void print(Document doc, java.io.PrintStream out, java.lang.String indent, boolean close, XmlWriter.Feature... features) throws java.io.IOException
doc - The document.out - The PrintStream.indent - Indent string. If not null, pretty printing is enabled.close - If true, out is closed in the end.features - The XmlWriter features to enable.java.io.IOException - When an IO error occurs.public static void save(Node node, boolean asDocument, java.io.Writer writer, java.lang.String indent, XmlWriter.Feature... features) throws java.io.IOException
node - The node.asDocument - If true and node is not a document, inserts
XML heading <?xml version="1.0" encoding="UTF-8"?> before writing
the node.false and node is not a document, directly writes the node.node is a document, this has no effect.writer - The writer.indent - Indent string. If not null, pretty printing is enabled.features - The XmlWriter features to enable.java.io.IOException - When an IO error occurs.public static void save(Document doc, java.io.Writer writer, java.lang.String indent, XmlWriter.Feature... features) throws java.io.IOException
doc - The document.writer - The writer.indent - Indent string. If not null, pretty printing is enabled.features - The XmlWriter features to enable.java.io.IOException - When an IO error occurs.public static void save(Node node, boolean asDocument, java.io.OutputStream os, java.lang.String indent, XmlWriter.Feature... features) throws java.io.IOException
node - The node.asDocument - If true and node is not a document, inserts
XML heading <?xml version="1.0" encoding="UTF-8"?> before writing
the node.false and node is not a document, directly writes the node.node is a document, this has no effect.os - The output stream.indent - Indent string. If not null, pretty printing is enabled.features - The XmlWriter features to enable.java.io.IOException - When an IO error occurs.public static void save(Document doc, java.io.OutputStream os, java.lang.String indent, XmlWriter.Feature... features) throws java.io.IOException
doc - The document.os - The output stream.indent - Indent string. If not null, pretty printing is enabled.features - The XmlWriter features to enable.java.io.IOException - When an IO error occurs.public static void save(Node node, boolean asDocument, java.lang.String filename, java.lang.String indent, XmlWriter.Feature... features) throws java.io.IOException
node - The node.asDocument - If true and node is not a document, inserts
XML heading <?xml version="1.0" encoding="UTF-8"?> before writing
the node.false and node is not a document, directly writes the node.node is a document, this has no effect.filename - The file name.indent - Indent string. If not null, pretty printing is enabled.features - The XmlWriter features to enable.java.io.IOException - When an IO error occurs.public static void save(Document doc, java.lang.String filename, java.lang.String indent, XmlWriter.Feature... features) throws java.io.IOException
doc - The document.filename - The file name.indent - Indent string. If not null, pretty printing is enabled.features - The XmlWriter features to enable.java.io.IOException - When an IO error occurs.public static void save(Node node, boolean asDocument, java.io.File file, java.lang.String indent, XmlWriter.Feature... features) throws java.io.IOException
node - The node.asDocument - If true and node is not a document, inserts
XML heading <?xml version="1.0" encoding="UTF-8"?> before writing
the node.false and node is not a document, directly writes the node.node is a document, this has no effect.file - The file.indent - Indent string. If not null, pretty printing is enabled.features - The XmlWriter features to enable.java.io.IOException - When an IO error occurs.public static void save(Document doc, java.io.File file, java.lang.String indent, XmlWriter.Feature... features) throws java.io.IOException
doc - The document.file - The file.indent - Indent string. If not null, pretty printing is enabled.features - The XmlWriter features to enable.java.io.IOException - When an IO error occurs.public static java.lang.String toString(Document doc, java.lang.String indent, XmlWriter.Feature... features)
public static java.lang.String toString(Node node, boolean asDocument, java.lang.String indent, XmlWriter.Feature... features)
Copyright © 2019. All rights reserved.