|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.thoughtworks.xstream.XStreamer
public class XStreamer
Self-contained XStream generator. The class is a utility to write XML streams that contain additionally the XStream that was used to serialize the object graph. Such a stream can be unmarshalled using this embedded XStream instance, that kept any settings.
Constructor Summary | |
---|---|
XStreamer()
|
Method Summary | |
---|---|
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 incuding 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XStreamer()
Method Detail |
---|
public java.lang.String toXML(XStream xstream, java.lang.Object obj) throws java.io.ObjectStreamException
java.io.ObjectStreamException
- if the XML contains non-serializable elements
com.thoughtworks.xstream.core.BaseException
- 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.
com.thoughtworks.xstream.core.BaseException
- 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 found
java.io.ObjectStreamException
- if the XML contains non-deserializable elements
com.thoughtworks.xstream.core.BaseException
- 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 found
java.io.ObjectStreamException
- if the XML contains non-deserializable elements
com.thoughtworks.xstream.core.BaseException
- 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 found
com.thoughtworks.xstream.core.BaseException
- 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 found
com.thoughtworks.xstream.core.BaseException
- if the object cannot be deserialized
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |