Home

Tatu Saloranta edited this page Jun 23, 2016 · 33 revisions
Clone this wiki locally

Home: Jackson XML databind Wiki

This is the home page for "jackson-xml-databind" project. The main deliverable of the project is a jar that contains extension to Jackson JSON library, to extend it so that it can bind XML to POJOs (and vice versa), instead of using JSON.

Basic usage

Intended usage is by instantiating 'com.fasterxml.jackson.xml.XmlMapper', and using it just like standard Jackson 'ObjectMapper' -- the difference being that instead of JSON, external data format is XML. That is:

import com.fasterxml.jackson.xml.XmlMapper;

ObjectMapper mapper = new XmlMapper();

For most usage that is all there is!

One alternative is that if you need to change some configuration, you may need to first configure module, then construct mapper:

JacksonXmlModule module = new JacksonXmlModule();
// to default to using "unwrapped" Lists:
module.setDefaultUseWrapper(false);
XmlMapper xmlMapper = new XmlMapper(module);

Note that underlying JsonParser and JsonGenerator instances are specific subtypes as well (FromXmlParser, ToXmlGenerator), but usually you don't have to worry about this.

Licensing

Project is licensed under Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt) like all official Jackson components.

FasterXML also explicitly allows users to alternatively license component under Lesser GPL (LGPL) 2.1 up to and including version 2.2. If so, they may want to repackage artifacts to reflect their choice of license to use.

Documentation

Javadocs

Downloads

Note: only needed if using a build system that requires local jars; otherwise you can just use Maven repository.

  • 2.7.5 jar (11-Jun-2016)
  • 2.6.6 jar (10-Jun-2015)
  • 2.5.5: jar (07-Dec-2015)
  • 2.4.6: jar (23-Apr-2015)
  • 2.3.5: jar (13-Jan-2015)
  • 2.2.3: jar (22-Apr-2013)
  • 2.1.3: jar (19-Jan-2013)
  • 2.0.5: jar (05-Sep-2012)

Snapshots can be found from Sonatype Maven Snapshot repository:

<snapshotRepository>
   <id>sonatype-nexus-snapshots</id>
   <name>Sonatype Nexus Snapshots</name>
   <url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>