JASIX, which is the contraction of JAva, bASIs and Xml, is a library which provides a couple of classes that can be used to interface Java objects with XML. The goal of this library is pretty close to the one of Sun’s own JAXB or Castor, which is to enable marshalling / unmarshalling of Java instances to XML.
JASIX is not as generic of a solution as Castor or JAXB, and will suit some applications better than others. It is especially well adapted to SwingFast and other applications that could benefit from the following features:
- Possibility to load (apply) a XML tree to an existing Java tree of instances. This differs from XML unserialization which can only create a brand new Java tree. This is very convenient for an application which updates periodically from XML-RPC results.
- Complete integration of XML processing in your code (compared to JAXB)
- Automatic generation of precise DTD, XML Schema and RELAX NG files to validate XML
- Handles creation and update of Swing components in response to XML input.
Now for the disavantages:
- Impose certain limitations in XML structure.
- It is probably slower than other solutions, though it is not noticeable for a GUI application on a PC.
- For now there is no validation of data types in XML documents, though it can be added manually.
Design of JASIX
The main ideas behing JASIX are:
- JASIX will provide “base classes” that are intended to be derived in order to create your own classes. It will then provide your classes with methods to directly interface with XML. Your classes do not have to derive JASIX directly: it can just be the base class of your base classes.
- Like Castor, it uses introspection and annotations (or attributes) to serialize to XML.
- JASIX classes can operate in different modes that use distinct XML representation, more or less compact, to suit one’s preferences.
JASIX is currently under development, alongside SwingFast. More details to come soon!