(DEPRECATED) -- included in `jackson-databind` as of Jackson 2.7
Java
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
release-notes
src Fix #3 Apr 13, 2015
.gitignore
.travis.yml
README.md
pom.xml

README.md

Project for Jackson module (jar) that adds supports for JDK datatypes included in version 7 which can not be directly supported by core databind due to baseline being JDK 6.

Status

Build Status Maven Central Javadoc

Starting with Jackson 2.7, this module will be DEPRECATED, as its handlers will be incorporated directly in core Databind.

Module is supported up until Jackson 2.6.

Usage

Maven dependency

To use module on Maven-based projects, use following dependency:

<dependency>
  <groupId>com.fasterxml.jackson.datatype</groupId>
  <artifactId>jackson-datatype-jdk7</artifactId>
  <version>2.6.2</version>
</dependency>    

Registering module

Like all standard Jackson modules (libraries that implement Module interface), registration is done as follows:

ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new Jdk7Module());

after which functionality is available for all normal Jackson operations: you can read JSON into supported JDK7 types, as well as write values of such types as JSON, so that for example:

// TODO: real example
Path p = ...;
String json = mapper.writeValueAsString(p);