This project provides a lightweight framework to serialize/deserialize (or marshall/unmarshall) java objects into XML.
One can thing "Yet another Object-to-XML mapping solution" ! The interesting point of this one is that it takes a original approach based on the strong data encapsulation paradigm of Object Oriented (OO) programming.
X-O lite is a thin layer above the Simple API for XML (SAX). It allows using SAX in a Object Oriented world.
Usual solutions defer all the parsing (and the document knowledge) to a 'Handler' class which will automatically fill-in the parsed objects (and, hence, access their internal representation) through some predefined interface or through introspection. The method proposed here will let each object parse it's own data and put it in it's own variables (with helpers reducing this code to the minimum). The parsing of the whole document is achieved by moving the parse control to each java object during the SAX event notification.
Java to XML serialization is also analyzed with emphasis on the symmetry between serialization and deserialization. In a symmetric world, you can build a java object tree from a sequence of SAX events or generate the same sequence of SAX events from the java object tree.
The result is XML-serializable objects that can be used as java serializable objects. You can combine those objects as you wish, the resulting object tree can also be serialized (back and forth) to XML without any extra work required.
Key benefits:
Download the distribution bundle containing the libraries (jars), the documentation and examples (and optionally the source code) from the Sourceforge project:
Another option, if you're using Maven for build, is to just add references to 'X-O lite' project in your POM as explained in the X-O lite 'Maven Metadata' page and let Maven resolve and download all dependencies.
Note: downloading and using 'X-O lite' implies that you agree with the Apache 2 open-source License terms.
Note: this documentation assume that you know what SAX is and the basic usage of it. To know more about SAX itself, go to http://en.wikipedia.org/wiki/Simple_API_for_XML or http://www.saxproject.org/.
This project is hosted by Sourceforge.
The Sourceforge project main page:
http://sourceforge.net/projects/xo-lite
provides access to the projects technical infrastructure (mailing lists, bug tracking, news, releases, SVN repository ...)