public class DBObjectHierarchicalStreamWriter extends Object implements com.thoughtworks.xstream.io.ExtendedHierarchicalStreamWriter
DBObjectHierarchicalStreamReader
to read the object back.Constructor and Description |
---|
DBObjectHierarchicalStreamWriter(com.mongodb.DBObject root)
Initialize the writer to write the object structure to the given
root DBObject. |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String name,
String value) |
void |
close() |
void |
endNode() |
void |
flush() |
void |
setValue(String text) |
void |
startNode(String name) |
void |
startNode(String name,
Class clazz) |
com.thoughtworks.xstream.io.HierarchicalStreamWriter |
underlyingWriter() |
public DBObjectHierarchicalStreamWriter(com.mongodb.DBObject root)
root
DBObject.
Note that the given root
DBObject must not contain any data yet.root
- The root DBObject to which the serialized structure will be added. Must not contain any data.public void startNode(String name)
startNode
in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
public void addAttribute(String name, String value)
addAttribute
in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
public void setValue(String text)
setValue
in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
public void endNode()
endNode
in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
public void flush()
flush
in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
public void close()
close
in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
public com.thoughtworks.xstream.io.HierarchicalStreamWriter underlyingWriter()
underlyingWriter
in interface com.thoughtworks.xstream.io.HierarchicalStreamWriter
Copyright © 2010–2018. All rights reserved.