This is the Home Page of Jackson Project; formerly known as the standard JSON library for Java (or JVM platform in general), or, as the "best JSON parser for Java". Or simply as "JSON for Java".
But more than that, Jackson is a suite of data-processing tools for Java (and JVM platform), including the flagship streaming JSON parser / generator library, matching data-binding library (POJOs to and from JSON) and additional data format modules to process data encoded in Avro, CBOR, CSV, Smile, XML or YAML; and even the large set of data format modules to support data types of widely used data types such as Joda, Guava and many more.
While the actual core components live under their own projects -- including the 3 core packages (streaming, databind, annotations, data format libraries, data type libraries, JAX-RS provider, and miscellaneous set of other extension modules -- this project act as the central hub for linking all the pieces together.
Jackson suite has two major branches: 1.x is in maintenance mode, and only bug-fix versions are released; 2.x is the actively developed version. These two major versions use different Java packages and Maven artifact ids, so they are not mutually compatible, but can peacefully co-exist: a project can depend on both Jackson 1.x and 2.x, without conflicts. This is by design and was chosen as the strategy to allow smoother migration from 1.x to 2.x.
The latest stable versions from these branches are:
Recommended way to use Jackson is through Maven repositories; releases are made to Central Maven Repository (CMR). Individual project pages typically contain download links, leading to CMR.
Release notes found from Jackson Releases page.
Most projects listed below are lead by Jackson development team; but some by other at-large Jackson community members. We try to keep versioning of modules compatible to reduce confusion regarding which versions work together.
Core modules are the foundation on which extensions (modules) build upon. These are three and they are known as:
- Streaming (docs) ("jackson-core") defines low-level streaming API, and includes JSON-specific implementations
- Annotations (docs) ("jackson-annotations") contains standard Jackson annotations
- Databind (docs) ("jackson-databind") implements data-binding (and object serialization) support on
streaming
package; it depends both onstreaming
andannotations
packages
These extensions are plug-in Jackson Module
s (registered with ObjectMapper.registerModule()
),
and add support for datatypes of various commonly used Java libraries, by adding
serializers and deserializers so that Jackson databind
package (ObjectMapper
/ ObjectReader
/ ObjectWriter
) can read and write these types.
- Guava: support for many of Guava datatypes.
- Hibernate: support for Hibernate features (lazy-loading, proxies)
- HPPC: support for High-Performance Primitive Containers containers
- Joda: support for types of Joda date/time library datatypes
- JDK7: support for JDK 7 data types not included in previous versions
- JDK8: support for JDK 8 data types not included in previous versions, including
Optional
(but excluding new Date types which are in JSR-310 module above) - JSR-310: support for "Java 8 Dates" (ones added in JDK 8)
- Also, for pre-Java8 users can use "ThreeTen" module for backport on Java7
- JSR-353: support for "Java JSON API" types (specifically, its tree model objects)
- org.json: support for "org.json JSON lib" types like
JSONObject
,JSONArray
- Yandex Bolts support for reading/writing types defined by Yandex Bolts collection types (Functional Programming inspired immutable collections)
Jackson JAX-RS Providers has handlers to add dataformat
support for JAX-RS implementations (like Jersey, RESTeasy, CXF).
Providers implement MessageBodyReader
and MessageBodyWriter
.
Supported formats currently include JSON
, Smile
, XML
and CBOR
.
Data format modules offer support for data formats other than JSON.
Most of them simply implement streaming
API abstractions, so that databinding component can be used as is; some offer (and few require) additional databind
level functionality for handling things like schemas.
Currently following data format modules are fully usable and supported:
- Avro: supports Avro data format, with
streaming
implementation plus additionaldatabind
-level support for Avro Schemas - CBOR: supports CBOR data format (a binary JSON variant).
- CSV: supports Comma-separated values format --
streaming
api, with optional conveniencedatabind
additions - Smile: supports Smile (binary JSON) -- 100% API/logical model compatible via
streaming
API, no changes fordatabind
- XML: supports XML; provides both
streaming
anddatabind
implementations. Similar to JAXB' "code-first" mode (no support for "XML Schema first", but can use JAXB beans) - YAML: supports YAML, which being similar to JSON is fully supported with simple
streaming
implementation
In addition, following modules are being developed, but not yet complete:
- Protobuf: will eventually be supported similar to
Avro
. Current state as of January 2015 is:protoc
(schema) handling works, using Square's Protoparser library- Serialization works, and is very fast (similar to the official Google Java protobuf project)
- Deserialization not yet implemented -- plan is to complete this by version 2.6
https://www.linkedin.com/groups/Can-anyone-recommend-good-Java-50472.S.226644043
There are also other data format modules, provided by developers outside Jackson core team:
- bson4jackson: adds support for BSON data format (by Mongo project).
- Implemented as full streaming implementation, which allows full access (streaming, data-binding, tree-model)
- Also see [MongoJack] library below; while not a dataformat module, it allows access to BSON data as well.
- MessagePack: adds MessagePack (aka
MsgPack
) support- Implemented as full streaming implementation, which allows full access (streaming, data-binding, tree-model)
- HOCON: experimental, partial implementation to support HOCON format -- work in progress
- Kotlin to handle native types of Kotlin (NOTE: 2.4.3 the first official release)
- Scala to handle native Scala types (including but not limited to Scala collection/map types, case classes)
Jackson annotations define intended properties and expected handling for POJOs, and in addition to Jackson itself using this for reading/writing JSON and other formats, it also allows generation of external schemas. Some of this functionality is included in above-mentioned data-format extensions; but there are also many stand-alone Schema tools, such as:
- Ember Schema Generator: Generate schemas for Ember.js
- JSON Schema generator: Generate JSON Schema, based on Jackson POJO introspection, including annotations
- Maven plug-in for JSON Schema generation (based on JSON Schema module)
Other fully usable modules by FasterXML team include:
- Afterburner: speed up databinding by 30-40% with bytecode generation to replace use of Reflection
- JAXB Annotations: allow use of
JAXB
annotations as an alternative (in addition to or instead of) standard Jackson annotations - Mr Bean: "type materialization" -- let Mr Bean generate implementation classes on-the-fly (NO source code generation), to avoid monkey code
- Paranamer: tiny extension for automatically figuring out creator (constructor, factory method) parameter names, to avoid having to specify
@JsonProperty
.
And finally, there are other still experimental modules provided by FasterXML team
- Guice: extension that allows injection values from Guice injectors (and basic Guice annotations), instead of standard
@JacksonInject
(or in addition to)- note: as of 2.2.x, this is in proof-of-concept stage; should become stable for 2.3
- JDK 8 Parameter names: Module that adds support for using a new JDK8 feature: ability to access names of constructor and method parameters.
While Jackson databind is a good choice for general-purpose data-binding, its footprint and startup overhead may be problematic in some domains, such as mobile phones; and especially for light usage (couple of reads or writes). In addition, some developers find full Jackson API overwhelming.
For all these reasons, we decided to create a much simpler, smaller library, which supports a subset of functionality, called Jackson jr. It builds on Jackson Streaming API, but does not depend on databind. As a result its size (both jar, and runtime memory usage) is considerably smaller; and its API is very compact.
- Jackson Ant path filter adds powerful filtering of properties to serialize, using Ant Path notation for hierarchic filtering
- jackson-docs is our Github Jackson documentation hub
- Jackson Wiki contains older documentation (some 1.x specific; but mostly relevant for both 1.x and 2.x)
- CowTalk -- Blog with lots of Jackson-specific content
- Jackson Users is a Jackson-specific discussion forum
Jackson bugs need to be reported against component they affect: for this reason, issue tracker
is not enabled for this project.
If you are unsure which specific project issue affects, the most likely component
is jackson-databind
, so you would use
Jackson Databind Issue Tracker.
- Jackson Contributor License Agreement (CLA) is a one-page document we need from every contributor of code (we will request it for pull requests)
Since you probably want opinions by Java developers NOT related to Jackson project, regarding which library to use, here are links to some of existing independent comparisons:
- Top 7 Open-Source JSON-binding providers (April 2014)
- [Be a Lazy but a Productive Android Developer, Part 3: JSON Parsing Library](http://java.dzone.com/articles/be-lazy-productive-android] (April 2014)
- "Can anyone recommend a good Java JSON library" (Linked-In group) (March 2013)
- "Which JSON library to use on Android?" (September 2012)
These are obsolete resources, mostly useful for historical interest: