public class XStreamer
extends java.lang.Object
| Constructor and Description |
|---|
XStreamer() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
fromXML(HierarchicalStreamDriver driver,
java.io.Reader xml)
Deserialize a self-contained XStream with object from an XML Reader.
|
java.lang.Object |
fromXML(HierarchicalStreamDriver driver,
java.lang.String xml)
Deserialize a self-contained XStream with object from a String.
|
java.lang.Object |
fromXML(java.io.Reader xml)
Deserialize a self-contained XStream with object from an XML Reader.
|
java.lang.Object |
fromXML(java.lang.String xml)
Deserialize a self-contained XStream with object from a String.
|
java.lang.String |
toXML(XStream xstream,
java.lang.Object obj)
Serialize an object including the XStream to a pretty-printed XML String.
|
void |
toXML(XStream xstream,
java.lang.Object obj,
java.io.Writer out)
Serialize an object including the XStream to the given Writer as pretty-printed XML.
|
public java.lang.String toXML(XStream xstream, java.lang.Object obj) throws java.io.ObjectStreamException
java.io.ObjectStreamException - if the XML contains non-serializable elementsXStreamException - if the object cannot be serializedtoXML(XStream, Object, Writer)public void toXML(XStream xstream, java.lang.Object obj, java.io.Writer out) throws java.io.IOException
Warning: XStream will serialize itself into this XML stream. To read such an XML code, you
should use fromXML(Reader) or one of the other overloaded
methods. Since a lot of internals are written into the stream, you cannot expect to use such
an XML to work with another XStream version or with XStream running on different JDKs and/or
versions. We have currently no JDK 1.3 support, nor will the PureReflectionConverter work
with a JDK less than 1.5.
java.io.IOException - if an error occurs reading from the Writer.XStreamException - if the object cannot be serializedpublic java.lang.Object fromXML(java.lang.String xml)
throws java.lang.ClassNotFoundException,
java.io.ObjectStreamException
java.lang.ClassNotFoundException - if a class in the XML stream cannot be foundjava.io.ObjectStreamException - if the XML contains non-deserializable elementsXStreamException - if the object cannot be deserializedtoXML(XStream, Object, Writer)public java.lang.Object fromXML(HierarchicalStreamDriver driver, java.lang.String xml) throws java.lang.ClassNotFoundException, java.io.ObjectStreamException
java.lang.ClassNotFoundException - if a class in the XML stream cannot be foundjava.io.ObjectStreamException - if the XML contains non-deserializable elementsXStreamException - if the object cannot be deserializedtoXML(XStream, Object, Writer)public java.lang.Object fromXML(java.io.Reader xml)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException - if an error occurs reading from the Reader.java.lang.ClassNotFoundException - if a class in the XML stream cannot be foundXStreamException - if the object cannot be deserializedtoXML(XStream, Object, Writer)public java.lang.Object fromXML(HierarchicalStreamDriver driver, java.io.Reader xml) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException - if an error occurs reading from the Reader.java.lang.ClassNotFoundException - if a class in the XML stream cannot be foundXStreamException - if the object cannot be deserializedJoe Walnes, http://xstream.codehaus.org/