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 Writer
options
- the serialization optionspublic XMLStreamWriterImpl(Writer writer)
writer
- a Writer
public void writeStartElement(String qname) throws IOException
qname
- a QNameIOException
public void writeEmptyElement(String qname) throws IOException
qname
- a QNameIOException
public void writeEndElement() throws IOException
IOException
public void close() throws IOException
IOException
public void flush() throws IOException
IOException
public void writeEndDocument() throws IOException
IOException
public void writeAttribute(String qname, String value) throws IOException
qname
- a QNamevalue
- the attribute valueIOException
public void writeNamespace(String prefix, String namespaceURI) throws IOException
prefix
- the namespace prefix.namespaceURI
- the namespace URIIOException
public void writeDefaultNamespace(String namespaceURI) throws IOException
namespaceURI
- the default namespaceIOException
public void writeComment(String comment) throws IOException
comment
- IOException
public void writeProcessingInstruction(String target) throws IOException
target
- a targetIOException
public void writeProcessingInstruction(String target, String text) throws IOException
target
- a targettext
- the instruction textIOException
public void writeDTD(String dtd) throws IOException
dtd
- IOException
public void writeCData(String data) throws IOException
data
- the data to writeIOException
public void writeEntityRef(String name) throws IOException
name
- the name of the referenceIOException
public void writeStartDocument() throws IOException
IOException
public void writeStartDocument(String version) throws IOException
version
- th xml-versionIOException
public void writeStartDocument(String encoding, String version) throws IOException
encoding
- the file encodingversion
- th XML-versionIOException
public void writeCharacters(String text) throws IOException
text
- xml charactersIOException
public 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
public void setEscapeWhitespaces(boolean escapeWhitespaces)
escapeWhitespaces
- the escapeWhitespaces to set"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"