Wednesday, November 12, 2008

XStream - Convert XMl to Java & Vice Versa

XStream is a simple library to serialize objects to XML and back again.
XStream xstream = new XStream();
Person joe = new Person("Joe", "Walnes");
String xml = xstream.toXML(joe)
The resulting XML looks like this:
Deserializing an object back from XML
Person newJoe = (Person)xstream.fromXML(xml);
Reference :

No comments:

Free Domain Names @!