public class StaxWriterImpl<N> extends Object implements StaxWriter<N>, XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT| Constructor and Description |
|---|
StaxWriterImpl(org.staxnav.Naming<N> naming,
XMLStreamWriter writer) |
StaxWriterImpl(org.staxnav.Naming<N> naming,
XMLStreamWriter writer,
XmlStreamingFormatter formatter) |
StaxWriterImpl(org.staxnav.Naming<N> naming,
XMLStreamWriter writer,
XmlStreamingFormatter formatter,
String encoding,
String version) |
| Modifier and Type | Method and Description |
|---|---|
void |
finish()
Calling finish will flush and close the underlying stream.
|
StaxWriter<N> |
writeAttribute(QName name,
String value)
Writes an attribute for an xml element.
|
StaxWriter<N> |
writeAttribute(String name,
String value)
Writes an attribute for an xml element.
|
StaxWriter<N> |
writeCData(String cdata)
Writes a cdata section
|
StaxWriter<N> |
writeComment(String comment)
Writes an xml comment
|
StaxWriter<N> |
writeContent(String content)
Writes xml content.
|
<V> StaxWriter<N> |
writeContent(WritableValueType<V> valueType,
V content)
Writes xml content based on the ValueType responsible for converting the content to string.
|
StaxWriter<N> |
writeDefaultNamespace(String uri)
Writes the default namespace
|
<V> StaxWriter<N> |
writeElement(N element,
String content)
Convenience method for calling
writeStartElement, writeContent, writeEndElement |
<V> StaxWriter<N> |
writeElement(N element,
WritableValueType<V> valueType,
V content)
Convenience method for calling
writeStartElement, writeContent, writeEndElement |
StaxWriter<N> |
writeEndElement()
Writes an end tag for the previously started element.
|
StaxWriter<N> |
writeNamespace(String prefix,
String uri)
Writes the namespace.
|
StaxWriter<N> |
writeStartElement(N element)
Writes the start tag of an xml element.
|
public StaxWriterImpl(org.staxnav.Naming<N> naming, XMLStreamWriter writer)
public StaxWriterImpl(org.staxnav.Naming<N> naming, XMLStreamWriter writer, XmlStreamingFormatter formatter)
public StaxWriterImpl(org.staxnav.Naming<N> naming, XMLStreamWriter writer, XmlStreamingFormatter formatter, String encoding, String version)
public StaxWriter<N> writeAttribute(String name, String value)
StaxWriterwriteAttribute in interface StaxWriter<N>name - the name of the attributevalue - the value of the attributepublic StaxWriter<N> writeAttribute(QName name, String value)
StaxWriterwriteAttribute in interface StaxWriter<N>name - QName object representing the name of the attributevalue - the value of the attributepublic StaxWriter<N> writeStartElement(N element) throws org.staxnav.StaxNavException
StaxWriterwriteStartElement in interface StaxWriter<N>element - element to startorg.staxnav.StaxNavException - if an exception occurspublic StaxWriter<N> writeEndElement() throws org.staxnav.StaxNavException
StaxWriterwriteEndElement in interface StaxWriter<N>org.staxnav.StaxNavException - if an exception occurspublic StaxWriter<N> writeContent(String content) throws org.staxnav.StaxNavException
StaxWriterwriteContent in interface StaxWriter<N>content - content to be writtenorg.staxnav.StaxNavException - if an exception occurspublic <V> StaxWriter<N> writeContent(WritableValueType<V> valueType, V content) throws org.staxnav.StaxNavException
StaxWriterwriteContent in interface StaxWriter<N>valueType - object responsible for writing content to stringcontent - content to be writtenorg.staxnav.StaxNavException - if an exception occurspublic <V> StaxWriter<N> writeElement(N element, String content) throws org.staxnav.StaxNavException
StaxWriterwriteStartElement, writeContent, writeEndElementwriteElement in interface StaxWriter<N>element - element to writecontent - content to be writtenorg.staxnav.StaxNavException - if an exception occurspublic <V> StaxWriter<N> writeElement(N element, WritableValueType<V> valueType, V content) throws org.staxnav.StaxNavException
StaxWriterwriteStartElement, writeContent, writeEndElementwriteElement in interface StaxWriter<N>element - element to writevalueType - object responsible for writing content to stringcontent - content to be writtenorg.staxnav.StaxNavException - if an exception occurspublic StaxWriter<N> writeNamespace(String prefix, String uri) throws org.staxnav.StaxNavException
StaxWriterwriteNamespace in interface StaxWriter<N>prefix - the prefix to bind the namespace touri - the uri to bind the prefix toorg.staxnav.StaxNavException - if an exception occurspublic StaxWriter<N> writeDefaultNamespace(String uri) throws org.staxnav.StaxNavException
StaxWriterwriteDefaultNamespace in interface StaxWriter<N>uri - the uri to bind the default namespace toorg.staxnav.StaxNavException - if an exception occurspublic StaxWriter<N> writeComment(String comment) throws org.staxnav.StaxNavException
StaxWriterwriteComment in interface StaxWriter<N>comment - the comment to writeorg.staxnav.StaxNavException - if an exception occurspublic StaxWriter<N> writeCData(String cdata) throws org.staxnav.StaxNavException
StaxWriterwriteCData in interface StaxWriter<N>cdata - content of the cdataorg.staxnav.StaxNavException - if an exception occurspublic void finish()
throws org.staxnav.StaxNavException
StaxWriterfinish in interface StaxWriter<N>org.staxnav.StaxNavException - if an exception occursCopyright © 2017 JBoss by Red Hat. All Rights Reserved.