public class StaxWriter extends AbstractXmlWriter
Constructor and Description |
---|
StaxWriter(QNameMap qnameMap,
javax.xml.stream.XMLStreamWriter out) |
StaxWriter(QNameMap qnameMap,
javax.xml.stream.XMLStreamWriter out,
boolean writeEnclosingDocument,
boolean namespaceRepairingMode)
Allows a StaxWriter to be created for partial XML output
|
StaxWriter(QNameMap qnameMap,
javax.xml.stream.XMLStreamWriter out,
boolean writeEnclosingDocument,
boolean namespaceRepairingMode,
NameCoder nameCoder)
Allows a StaxWriter to be created for partial XML output
|
StaxWriter(QNameMap qnameMap,
javax.xml.stream.XMLStreamWriter out,
boolean writeEnclosingDocument,
boolean namespaceRepairingMode,
XmlFriendlyReplacer replacer)
Deprecated.
As of 1.4 use
StaxWriter(QNameMap, XMLStreamWriter, boolean, boolean, NameCoder)
instead |
StaxWriter(QNameMap qnameMap,
javax.xml.stream.XMLStreamWriter out,
NameCoder nameCoder)
Allows a StaxWriter to be created for partial XML output
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.String name,
java.lang.String value) |
void |
close()
Call this method when you're finished with me
|
void |
endNode() |
void |
flush()
Flush the writer, if necessary.
|
protected QNameMap |
getQNameMap() |
protected javax.xml.stream.XMLStreamWriter |
getXMLStreamWriter() |
boolean |
isNamespaceRepairingMode()
Is StAX namespace repairing mode on or off?
|
void |
setValue(java.lang.String text)
Write the value (text content) of the current node.
|
void |
startNode(java.lang.String name) |
escapeXmlName
encodeAttribute, encodeNode, startNode, underlyingWriter
public StaxWriter(QNameMap qnameMap, javax.xml.stream.XMLStreamWriter out) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public StaxWriter(QNameMap qnameMap, javax.xml.stream.XMLStreamWriter out, NameCoder nameCoder) throws javax.xml.stream.XMLStreamException
qnameMap
- is the mapper of Java class names to QNamesout
- the stream to output tonameCoder
- the xml-friendly replacer to escape Java namesjavax.xml.stream.XMLStreamException
- if the events could not be written to the outputpublic StaxWriter(QNameMap qnameMap, javax.xml.stream.XMLStreamWriter out, boolean writeEnclosingDocument, boolean namespaceRepairingMode, NameCoder nameCoder) throws javax.xml.stream.XMLStreamException
qnameMap
- is the mapper of Java class names to QNamesout
- the stream to output towriteEnclosingDocument
- a flag to indicate whether or not the start/end document
events should be writtennamespaceRepairingMode
- a flag to enable StAX' namespace repairing modenameCoder
- the xml-friendly replacer to escape Java namesjavax.xml.stream.XMLStreamException
- if the events could not be written to the outputpublic StaxWriter(QNameMap qnameMap, javax.xml.stream.XMLStreamWriter out, boolean writeEnclosingDocument, boolean namespaceRepairingMode) throws javax.xml.stream.XMLStreamException
qnameMap
- is the mapper of Java class names to QNamesout
- the stream to output towriteEnclosingDocument
- a flag to indicate whether or not the start/end document
events should be writtenjavax.xml.stream.XMLStreamException
- if the events could not be written to the outputpublic StaxWriter(QNameMap qnameMap, javax.xml.stream.XMLStreamWriter out, boolean writeEnclosingDocument, boolean namespaceRepairingMode, XmlFriendlyReplacer replacer) throws javax.xml.stream.XMLStreamException
StaxWriter(QNameMap, XMLStreamWriter, boolean, boolean, NameCoder)
insteadqnameMap
- is the mapper of Java class names to QNamesout
- the stream to output towriteEnclosingDocument
- a flag to indicate whether or not the start/end document
events should be writtenreplacer
- the xml-friendly replacer to escape Java namesjavax.xml.stream.XMLStreamException
- if the events could not be written to the outputpublic void flush()
HierarchicalStreamWriter
public void close()
public void addAttribute(java.lang.String name, java.lang.String value)
public void endNode()
public void setValue(java.lang.String text)
HierarchicalStreamWriter
public void startNode(java.lang.String name)
public boolean isNamespaceRepairingMode()
protected QNameMap getQNameMap()
protected javax.xml.stream.XMLStreamWriter getXMLStreamWriter()
Copyright © 2004–2024 XStream. All rights reserved.