com.thoughtworks.xstream.io.xml
Class StaxWriter
java.lang.Object
com.thoughtworks.xstream.io.xml.StaxWriter
- All Implemented Interfaces:
- HierarchicalStreamWriter
- public class StaxWriter
- extends java.lang.Object
- implements HierarchicalStreamWriter
A stream writing that outputs to a StAX stream writer
- Version:
- $Revision: 1.6 $
- Author:
- James Strachan
Constructor Summary |
StaxWriter(QNameMap qnameMap,
javax.xml.stream.XMLStreamWriter out)
|
StaxWriter(QNameMap qnameMap,
javax.xml.stream.XMLStreamWriter out,
boolean writeEnclosingDocument)
Allows a StaxWriter to be created for partial XML output |
Method Summary |
void |
addAttribute(java.lang.String name,
java.lang.String value)
|
void |
close()
Call this method when you're finished with me |
void |
endNode()
|
void |
setValue(java.lang.String text)
|
void |
startNode(java.lang.String name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StaxWriter
public StaxWriter(QNameMap qnameMap,
javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
StaxWriter
public StaxWriter(QNameMap qnameMap,
javax.xml.stream.XMLStreamWriter out,
boolean writeEnclosingDocument)
throws javax.xml.stream.XMLStreamException
- Allows a StaxWriter to be created for partial XML output
- Parameters:
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 written
- Throws:
javax.xml.stream.XMLStreamException
- if the events could not be written to the output
close
public void close()
- Call this method when you're finished with me
addAttribute
public void addAttribute(java.lang.String name,
java.lang.String value)
- Specified by:
addAttribute
in interface HierarchicalStreamWriter
endNode
public void endNode()
- Specified by:
endNode
in interface HierarchicalStreamWriter
setValue
public void setValue(java.lang.String text)
- Specified by:
setValue
in interface HierarchicalStreamWriter
startNode
public void startNode(java.lang.String name)
- Specified by:
startNode
in interface HierarchicalStreamWriter
Joe Walnes, http://xstream.codehaus.org/