This post originated from an RSS feed registered with Agile Buzz
by Joe Walnes.
Original Post: XStream: how to serialize objects to non XML formats
Feed Title: Joe's New Jelly
Feed URL: http://joe.truemesh.com/blog/index.rdf
Feed Description: The musings of a ThoughtWorker obsessed with Agile, XP, maintainability, Java, .NET, Ruby and OpenSource. Mmm'kay?
Person person = ...;
xstream.marshal(stuff, new AnAlternativeWriter(out));
Producing the slightly more digestible:
com.blah.Person
firstName = Joe
lastName = Walnes
homePhone
areaCode = 123
number = 433535
cellPhone
areaCode = 4545
number = 4534
To gain roundtrip serialization/deserialization support in alternative formats to XML, you need to provide your own implementations of both HierarchicalStreamWriter and HierarchicalStreamReader.