Feature: "mini-JAXB"
(see Jira entry JACKSON-394 for details)
One of major new functionality in Jackson 1.7 is the ability to serialize POJOs as XML (and vice versa, read POJOs from XML). While this is not done using JAXB API or implementations (although it can use Jackson's support for JAXB annotations), it can be thought of as subset of JAXB functionality.
This was implemented as a separate project: see https://github.com/FasterXML/jackson-xml-databind.
Implementation uses Stax components (package javax.xml.stream; XMLStreamReader, XMLStreamWriter and so on) for actual XML parsing and writing; little bit of adapters in org.codehaus.jackson.xml package, and otherwise standard Jackson data binding (jackson-mappeR) components for actual POJO handling.
Usage
To be able to use the functionality, you need to include jackson-xml-databind jar (using Maven, or by downloading jar from https://github.com/FasterXML/jackson-xml-databind). This jar depends on jackson 'core', 'mapper' and 'xc' packages which are also needed; as well as a Stax XML processor like Woodstox.
Most commonly you will instantiate (org.codehaus.jackson.xml.) XmlMapper instance and otherwise do everything the same (except with xml input and output); like so:
XmlMapper mapper = new XmlMapper(); String xml = mapper.writeValue(new MyBean()); MyBean bean = mapper.readValue(xml, MyBean.class);
Note that although you can also use FromXmlParser (implementation of JsonParser) and ToXmlGenerator (implementation of JsonGenerator) components for reading and writing xml, these are somewhat specialized components so they are not as useful as mapper.
