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 QNameIOExceptionpublic void writeEmptyElement(String qname) throws IOException
qname - a QNameIOExceptionpublic void writeEndElement()
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic void flush()
throws IOException
IOExceptionpublic void writeEndDocument()
throws IOException
IOExceptionpublic void writeAttribute(String qname, String value) throws IOException
qname - a QNamevalue - the attribute valueIOExceptionpublic void writeNamespace(String prefix, String namespaceURI) throws IOException
prefix - the namespace prefix.namespaceURI - the namespace URIIOExceptionpublic void writeDefaultNamespace(String namespaceURI) throws IOException
namespaceURI - the default namespaceIOExceptionpublic void writeComment(String comment) throws IOException
comment - IOExceptionpublic void writeProcessingInstruction(String target) throws IOException
target - a targetIOExceptionpublic void writeProcessingInstruction(String target, String text) throws IOException
target - a targettext - the instruction textIOExceptionpublic void writeDTD(String dtd) throws IOException
dtd - IOExceptionpublic void writeCData(String data) throws IOException
data - the data to writeIOExceptionpublic void writeEntityRef(String name) throws IOException
name - the name of the referenceIOExceptionpublic void writeStartDocument()
throws IOException
IOExceptionpublic void writeStartDocument(String version) throws IOException
version - th xml-versionIOExceptionpublic void writeStartDocument(String encoding, String version) throws IOException
encoding - the file encodingversion - th XML-versionIOExceptionpublic void writeCharacters(String text) throws IOException
text - xml charactersIOExceptionpublic void writeCharacters(char[] buffer,
int off,
int length)
throws IOException
buffer - a character arrayoff - the offset within the arraylength - the amount of character to writeIOExceptionpublic void setEscapeWhitespaces(boolean escapeWhitespaces)
escapeWhitespaces - the escapeWhitespaces to set"Copyright © 2010 - 2016 Adobe Systems Incorporated. All Rights Reserved"