Skip to content

FasterXML/jackson-datatypes-collections

2.15
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
November 22, 2022 20:52
November 5, 2022 16:39
November 29, 2022 19:46
November 29, 2022 19:46
...
June 10, 2016 20:32
January 19, 2016 22:47
November 7, 2022 15:25
November 6, 2022 22:22

Overview

This is a multi-module umbrella project for various Jackson Datatype modules to support 3rd party Collection libraries.

Currently included are:

License

All modules are licensed under Apache License 2.0.

Build Status

Build Status

Usage, general

Maven dependencies

To use these format backends Maven-based projects, use following dependency:

<dependency>
  <groupId>com.fasterxml.jackson.datatype</groupId>
  <artifactId>jackson-datatype-[COLLECTION]</artifactId>
  <version>2.13.3</version>
</dependency>

where COLLECTION would be one of guava, hppc, pcollections, or eclipse-collections (replace version with the latest available).

You may also use jackson-bom for defining consistent sets of versions of various Jackson components.

NOTE! Parent pom itself only specifies defaults to individual modules but DOES NOT include them, so you CAN NOT just add dependency to jackson-datatypes-collections. Individual datatype modules need to be included explicitly (or via some other pom that depends on them).

Registration with ObjectMapper

Like all standard Jackson modules (libraries that implement Module interface), registration for Collections datatypes is done using one of 2 mechanisms:

ObjectMapper mapper;

// New; 2.10.x / 3.0:
mapper = JsonMapper.builder() // or mapper for other formats
    .addModule(new GuavaModule())
    .addModule(new HppcModule())
    .addModule(new PCollectionsModule())
    .build();

// Old (2.x), not available on 3.x:
mapper = new ObjectMapper() // or mapper for other formats
    .registerModule(new GuavaModule())
    .registerModule(new HppcModule())
    .registerModule(new PCollectionsModule())
    .registerModule(new EclipseCollectionsModule())
    ;

after which datatype read/write support is available for all normal Jackson operations, including support for nested types.

Usage, per-datatype

See READMEs of individual modules for datatype-specific configuration, options and so on:

Usage with Spring Boot

@Bean
public Jackson2ObjectMapperBuilderCustomizer customize()
{
    return builder -> builder.modules( new GuavaModule() );
}

About

Jackson project that contains various collection-oriented datatype libraries: Eclipse Collections, Guava, HPPC, PCollections

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published