public class XMLStreamWriterImpl
extends java.lang.Object
| Constructor and Description |
|---|
XMLStreamWriterImpl(java.io.Writer writer)
Default constructor providing a writer the XML is written to.
|
XMLStreamWriterImpl(java.io.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(java.lang.String qname,
java.lang.String value)
Writes an attribute into an open tag.
|
void |
writeCData(java.lang.String data)
Writes CData.
|
void |
writeCharacters(char[] buffer,
int off,
int length)
Writes a part of a char array.
|
void |
writeCharacters(java.lang.String text)
Writes XML-characters.
|
void |
writeComment(java.lang.String comment)
Writes a comment.
|
void |
writeDefaultNamespace(java.lang.String namespaceURI)
Writes the default namespace
|
void |
writeDTD(java.lang.String dtd)
Writes the DTD.
|
void |
writeEmptyElement(java.lang.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(java.lang.String name)
Writes an entity reference.
|
void |
writeNamespace(java.lang.String prefix,
java.lang.String namespaceURI)
Writes a namespace attribute and tracks if the namespace is already defined.
|
void |
writeProcessingInstruction(java.lang.String target)
Writes a processing instruction.
|
void |
writeProcessingInstruction(java.lang.String target,
java.lang.String text)
Writes a processing instruction.
|
void |
writeStartDocument()
Writes the XML-header and version.
|
void |
writeStartDocument(java.lang.String version)
Writes the XML-header and version.
|
void |
writeStartDocument(java.lang.String encoding,
java.lang.String version)
Writes the XML-header, encoding and version.
|
void |
writeStartElement(java.lang.String qname)
Writes a start tag.
|
public XMLStreamWriterImpl(java.io.Writer writer,
SerializeOptions options)
writer - a Writeroptions - the serialization optionspublic XMLStreamWriterImpl(java.io.Writer writer)
writer - a Writerpublic void writeStartElement(java.lang.String qname)
throws java.io.IOException
qname - a QNamejava.io.IOException - If an I/O error occurspublic void writeEmptyElement(java.lang.String qname)
throws java.io.IOException
qname - a QNamejava.io.IOException - If an I/O error occurspublic void writeEndElement()
throws java.io.IOException
java.io.IOException - If an I/O error occurspublic void close()
throws java.io.IOException
java.io.IOException - If an I/O error occurspublic void flush()
throws java.io.IOException
java.io.IOException - If an I/O error occurspublic void writeEndDocument()
throws java.io.IOException
java.io.IOException - If an I/O error occurspublic void writeAttribute(java.lang.String qname,
java.lang.String value)
throws java.io.IOException
qname - a QNamevalue - the attribute valuejava.io.IOException - If an I/O error occurspublic void writeNamespace(java.lang.String prefix,
java.lang.String namespaceURI)
throws java.io.IOException
prefix - the namespace prefix.namespaceURI - the namespace URIjava.io.IOException - If an I/O error occurspublic void writeDefaultNamespace(java.lang.String namespaceURI)
throws java.io.IOException
namespaceURI - the default namespacejava.io.IOException - If an I/O error occurspublic void writeComment(java.lang.String comment)
throws java.io.IOException
comment - the comment to writejava.io.IOException - If an I/O error occurspublic void writeProcessingInstruction(java.lang.String target)
throws java.io.IOException
target - a targetjava.io.IOException - If an I/O error occurspublic void writeProcessingInstruction(java.lang.String target,
java.lang.String text)
throws java.io.IOException
target - a targettext - the instruction textjava.io.IOException - If an I/O error occurspublic void writeDTD(java.lang.String dtd)
throws java.io.IOException
dtd - the dtd to writejava.io.IOException - If an I/O error occurspublic void writeCData(java.lang.String data)
throws java.io.IOException
data - the data to writejava.io.IOException - If an I/O error occurspublic void writeEntityRef(java.lang.String name)
throws java.io.IOException
name - the name of the referencejava.io.IOException - If an I/O error occurspublic void writeStartDocument()
throws java.io.IOException
java.io.IOException - If an I/O error occurspublic void writeStartDocument(java.lang.String version)
throws java.io.IOException
version - th xml-versionjava.io.IOException - If an I/O error occurspublic void writeStartDocument(java.lang.String encoding,
java.lang.String version)
throws java.io.IOException
encoding - the file encodingversion - th XML-versionjava.io.IOException - If an I/O error occurspublic void writeCharacters(java.lang.String text)
throws java.io.IOException
text - xml charactersjava.io.IOException - If an I/O error occurspublic void writeCharacters(char[] buffer,
int off,
int length)
throws java.io.IOException
buffer - a character arrayoff - the offset within the arraylength - the amount of character to writejava.io.IOException - If an I/O error occurspublic void setEscapeWhitespaces(boolean escapeWhitespaces)
escapeWhitespaces - the escapeWhitespaces to set"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"