Example
The Betwixt library provides an XML introspection mechanism for mapping beans to XML in a flexible way. It is implemented using an XMLIntrospector and XMLBeanInfo classes which are similar to the standard Introspector and BeanInfo from the Java Beans specification.
Betwixt provides a way of turning beans into XML as well as automatically generating digester rules in a way that can be customized on a per type manner in the same way that the BeanInfo mechanism can be used to customize the default introspection on a java object.
More on smooks 1.1. Current version is 1.2 - keep in mind.
Interesting - java-to-java transformations, validations simple and business-rule-based, persistence "cartridge" with JPA support.
Spring has support for marshaling/unmarshaling. Go figure. "Of course it's in Spring!"
Ease of configuration. Spring's bean factory makes it easy to configure marshallers, without needing to construct JAXB context, JiBX binding factories, etc. The marshallers can be configured as any other bean in your application context. Additionally, XML Schema-based configuration is available for a number of marshallers, making the configuration even simpler.
Consistent Interfaces. Spring's O/X mapping operates through two global interfaces: the Marshaller
and Unmarshaller
interface. These abstractions allow you to switch O/X mapping frameworks with relative ease, with little or no changes required on the classes that do the marshalling. This approach has the additional benefit of making it possible to do XML marshalling with a mix-and-match approach (e.g. some marshalling performed using JAXB, other using XMLBeans) in a non-intrusive fashion, leveraging the strength of each technology.
Consistent Exception Hierarchy. Spring provides a conversion from exceptions from the underlying O/X mapping tool to its own exception hierarchy with the XmlMappingException
as the root exception. As can be expected, these runtime exceptions wrap the original exception so no information is lost.
Example
JXPath and Commons Digester examples