Details
-
Type: New Feature
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 0.6
-
Fix Version/s: 1.2
-
Component/s: Converters
-
Labels:None
Description
Serialising the state of xstream so you can have the same mode of deserialisation at a separate point in time may be important for many applications. This is currently not possible (javaClassConverter is the cause i think).
import com.thoughtworks.xstream.*;
import junit.framework.*;
public class XStreamTesting extends TestCase{
/**
*/
{ super(""); }
public XStreamTesting()
public void testXStreamSelf()
{ XStream stream = new XStream(); stream.setMode(XStream.XPATH_REFERENCES); System.out.println(stream.toXML(stream)); XStream newStream = (XStream)stream.fromXML(stream.toXML(stream)); }}
Something to be careful of is that XStream will never be able to serialize itself as whilst it is serializing an object its internal state is changing - dangerous!
However, I see no reason why one XStream instance cannot serialize another XStream instance.