Skip to content

isigma/jackson-datatype-jdk8

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Status

Build Status

First public version is 2.4.3: module is still somewhat experimental but planned to be stable with 2.5.

Usage

Maven dependency

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

<dependency>
  <groupId>com.fasterxml.jackson.datatype</groupId>
  <artifactId>jackson-datatype-jdk8</artifactId>
  <version>2.4.3</version>
</dependency>    

(or whatever version is most up-to-date at the moment)

Registering module

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

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

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

// TODO: real example
Optional<String> str = ...;
String json = mapper.writeValueAsString(str);

More

See Wiki for more information (javadocs, downloads).

About

Support for new JDK8-specific types, such as Optional

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%