Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Overview

Jackson data format module for reading and writing Ion encoded data.

Project is licensed under Apache License 2.0.

Status

Since version 2.8 this module is considered complete and production ready. All Jackson layers (streaming, databind, tree model) are supported.

To use this extension on Maven-based projects, use following dependency:

<dependency>
  <groupId>com.fasterxml.jackson.dataformat</groupId>
  <artifactId>jackson-dataformat-ion</artifactId>
  <version>2.16.0</version>
</dependency>

Usage

Basic usage is by using IonObjectMapper instead of basic ObjectMapper; or, if only using streaming parser/generator, IonFactory instead of JsonFactory.

ObjectMapper mapper = new IonObjectMapper();
// and then read/write data as usual
SomeType value = ...;
byte[] encoded = mapper.writeValueAsBytes(value);
SomeType otherValue = mapper.readValue(data, SomeType.class);

java.time JSR 310

Version 2.12 (released on November 28, 2020) added support for (de)serializing some java.time classes directly from/to Ion timestamp values. To enable it, you need to register module IonJavaTimeModule like so:

IonObjectMapper mapper = IonObjectMapper.builder()
        .addModule(new IonJavaTimeModule())
        //Disable writing dates as numeric timestamp values to allow writing as Ion timestamp values. 
        .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
        .build();

Documentation

See Wiki (includes Javadocs)