Jackson for data formats other than JSON
Out of the box, Jackson supports writing POJOs as JSON (serialization) as well as reading POJOs from JSON (deserialization). Starting with Jackson 1.6 there is also equivalent support for "Smile" binary format, which has data model fully compatible with JSON (i.e. it is "binary JSON serialization"). With 2.0, Smile support has been separated to an extension module.
But beyond work on JSON (and strictly data model equivalent format(s)), there are also projects underway to reuse Jackson data binding on formats that are not JSON compatible. This is based on observation that although low-level APIs were created to work on JSON, they are simple enough to work on other simple data formats, with minor (or no) changes at API level; just by implementing JsonParser and JsonGenerator abstractions (and if necessary, related pieces like JsonFactory) it is often possible to add support for binding POJOs to/from alternative data formats.
Projects that aim to support alternative data formats include:
Projects lead by FasterXML:
Jackson support for Smile (separate module since 2.0)
Jackson XML data binding project adds support for serializing POJOs as XML (and deserializing from XML)
Jackson support for CSV project adds support for reading and writing CSV to convert between POJOs, CSV.
Jackson support for YAML project adds support for reading and writing YAML to convert between POJOs, YAML.
Jackson support for Avro project adds support for reading and writing Avro encoded data.
and some incomplete projects (concept stage):
Other related projects:
- BSON:
Bson4Jackson adds support for BSON (JSON-like binary format, see BSON spec), used by MongoDB
Tutorial by author
- XML:
json2xml converts JSON input into SAX XML events, which allows for using things like XSLT and DOM for JSON input
See Also
Jackson Module projects also expand Jackson functionality.
