public class XMLStreamWriterImpl extends Object
| Constructor and Description |
|---|
XMLStreamWriterImpl(Writer writer)
Default constructor providing a writer the XML is written to.
|
XMLStreamWriterImpl(Writer writer,
SerializeOptions options)
Default constructor providing a writer the XML is written to
and the serializsation options to determine indents, whitespaces and lineendings.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the writer.
|
void |
flush()
Calls flush() on the writer.
|
void |
setEscapeWhitespaces(boolean escapeWhitespaces) |
void |
writeAttribute(String qname,
String value)
Writes an attribute into an open tag.
|
void |
writeCData(String data)
Writes CData.
|
void |
writeCharacters(char[] buffer,
int off,
int length)
Writes a part of a char array.
|
void |
writeCharacters(String text)
Writes XML-characters.
|
void |
writeComment(String comment)
Writes a comment.
|
void |
writeDefaultNamespace(String namespaceURI)
Writes the default namespace
|
void |
writeDTD(String dtd)
Writes the DTD.
|
void |
writeEmptyElement(String qname)
Differs from writeStartElement in that writeEndElement needs and must not be called.
|
void |
writeEndDocument()
Completes the document by writing the end tags for all open tags.
|
void |
writeEndElement()
Writes a closing tag if the tag in scope has body elements or > if its
empty.
|
void |
writeEntityRef(String name)
Writes an entity reference.
|
void |
writeNamespace(String prefix,
String namespaceURI)
Writes a namespace attribute and tracks if the namespace is already defined.
|
void |
writeProcessingInstruction(String target)
Writes a processing instruction.
|
void |
writeProcessingInstruction(String target,
String text)
Writes a processing instruction.
|
void |
writeStartDocument()
Writes the XML-header and version.
|
void |
writeStartDocument(String version)
Writes the XML-header and version.
|
void |
writeStartDocument(String encoding,
String version)
Writes the XML-header, encoding and version.
|
void |
writeStartElement(String qname)
Writes a start tag.
|
public XMLStreamWriterImpl(Writer writer, SerializeOptions options)
writer - a Writeroptions - the serialization optionspublic XMLStreamWriterImpl(Writer writer)
writer - a Writerpublic void writeStartElement(String qname) throws IOException
qname - a QNameIOException - If an I/O error occurspublic void writeEmptyElement(String qname) throws IOException
qname - a QNameIOException - If an I/O error occurspublic void writeEndElement()
throws IOException
IOException - If an I/O error occurspublic void close()
throws IOException
IOException - If an I/O error occurspublic void flush()
throws IOException
IOException - If an I/O error occurspublic void writeEndDocument()
throws IOException
IOException - If an I/O error occurspublic void writeAttribute(String qname, String value) throws IOException
qname - a QNamevalue - the attribute valueIOException - If an I/O error occurspublic void writeNamespace(String prefix, String namespaceURI) throws IOException
prefix - the namespace prefix.namespaceURI - the namespace URIIOException - If an I/O error occurspublic void writeDefaultNamespace(String namespaceURI) throws IOException
namespaceURI - the default namespaceIOException - If an I/O error occurspublic void writeComment(String comment) throws IOException
comment - the comment to writeIOException - If an I/O error occurspublic void writeProcessingInstruction(String target) throws IOException
target - a targetIOException - If an I/O error occurspublic void writeProcessingInstruction(String target, String text) throws IOException
target - a targettext - the instruction textIOException - If an I/O error occurspublic void writeDTD(String dtd) throws IOException
dtd - the dtd to writeIOException - If an I/O error occurspublic void writeCData(String data) throws IOException
data - the data to writeIOException - If an I/O error occurspublic void writeEntityRef(String name) throws IOException
name - the name of the referenceIOException - If an I/O error occurspublic void writeStartDocument()
throws IOException
IOException - If an I/O error occurspublic void writeStartDocument(String version) throws IOException
version - th xml-versionIOException - If an I/O error occurspublic void writeStartDocument(String encoding, String version) throws IOException
encoding - the file encodingversion - th XML-versionIOException - If an I/O error occurspublic void writeCharacters(String text) throws IOException
text - xml charactersIOException - If an I/O error occurspublic void writeCharacters(char[] buffer,
int off,
int length)
throws IOException
buffer - a character arrayoff - the offset within the arraylength - the amount of character to writeIOException - If an I/O error occurspublic void setEscapeWhitespaces(boolean escapeWhitespaces)
escapeWhitespaces - the escapeWhitespaces to setCopyright © 2011–2016 Adobe Systems Incorporated. All rights reserved.