Skip to content

Presentation Jackson 2.0

cowtowncoder edited this page Aug 8, 2012 · 9 revisions

Jackson 2.0 Feature Overview

Jackson 2.0 is the first Major release after official 1.x versions. As the major version bump indicates, 2.0 is the first official release that is NOT fully backwards compatible.

This presentation gives an overview of changes that occured between versions 1.9 and 2.0.

Background: why bump major version?

Although progression from 1.9 to 2.0 seems natural from "increasing numbers" perspective, we did actually seriously consider going to 1.10 and possibly more versions, with the usual rules of backwards compatibility.

But after so many minor releases, Jackson had accumulated some technical debt, in form of deprecated methods, as well as many non-intuitive naming choices and non-optimal packaging decisions. Further, external developments like awesomeness of GitHub and steady improvement of Maven build system were suggesting that we might want to improve building and release management aspects as well; changes that would cause some backwards-compatibility issues of their own.

None of the issues alone would have been sufficient to justify break from expected compatibility (in our opinion); but taken as whole, it seemed like time would be ripe to make a clean break, to pay down most of the technical debt.

The Cleanup ("project Spring cleaning")

The rough summary of clean-up changes that started Jackson 2.0 development is:

  1. Moving code, projects to GitHub
  1. Change build from Ant to Maven
  • Simplifies releases significantly; can deploy to Sonatype OSS Maven repository (which syncs to central Maven repo)
  1. Remove ALL methods, types, annotations that were deprecated in 1.9!
  2. Rename/move
  • Rename Java packages, mostly to allow 1.x and 2.0 to co-exist; in some cases to make more intuitive
  • Rename a small number of misnamed classes (for example DeserializationConfig.Feature as DeserializationFeature)
  • Move couple of classes to clean up package structure (split "too big" packages)

New feature: full handling of Object Graphs

Other Jackson 2.0 features

Support Builder-style objects

JsonView for deserialization

Annotation Bundles

@JsonUnwrapped.prefix, .suffix

JAX-RS module annotations

@JsonIgnoreProperties as property annotation

Improved config for ObjectReader/ObjectWriter

JsonSeriaizer.isEmpty()

Jackson 2.0 Data format support

Although Jackson 1.x had introduced some non-JSON backends (notably Smile and XML), one significant area for improvement for 2.0 API was to support even wider range of alternate data formats.

Here is a high-level overview of all data formats that Jackson 2.0 supports, either directly or via extension modules

  1. JSON -- the baseline format that Jackson supports out-of-the-box
  2. Smile (since 1.6) -- 100% feature parity, compatibility with JSON at Streaming API level
  3. BSON (since ~1.7): support for BSON, JSON-like data format used by MongoDB
  • external project (not under FasterXML), implemented by Michel Kramer (with help from Jackson team)
  1. XML (since 1.8)
  2. CSV (1.9 (preliminary), 2.0 (full)
  3. YAML (since 2.0): uses SnakeYAML library for parsing.
Clone this wiki locally