With serialization
you can convert the java objects in to XML format easily. For this purpose
there is an open source library called XStream. With this library you
serialize and deserialize the java objects.
_______________________________________________
_______________________________________________
You
have to include the following import statement once you have installed
that library in your system and made the appropriate changes in the
class path.
import
com.thoughtworks.xstream.XStream;
To create
an xstream object you can use statements like,
XStream
xs = new XStream();
Once you
have created this xstream object then you can serialize any class to
XML format using code like,
String
to_xml = xs.toXML(ur_class);
where 'ur_class'
is the class that you want to serialize. If you have set the values
in your class member variables in your program then you can get an XML
output with the element names as the member variable names and the values
of the elements as that of the values set for the member variables.
With this library in place you can also deserialize from the XML document
in to Java objects.
Google releases serialization scheme (The Register)
Pedantic programmers hold love-in Fail and You Protocol buffer : it's the object serialization scheme the pretentious little shit on your development team has been talking at you about during lunch hours for the past couple of days. You've been feigning interest with a steady stream of "oh-yeahs" and "that-sounds-cools", so you don't really know what it is.…
Google open-sources XML-alternative Protocol Buffers (CNET via Yahoo! News)
XML, it seems, has run out of steam for Google.
Google open sources XML alternative Protocol Buffers (ZDNet Asia)
Software company releases software for encode data in multiple formats in a single binary format for network communications or storage.