Jackson-dataformat-Rison

Support for reading and writing Rison-encoded data via Jackson abstractions.

License

License

Categories

Categories

Data Jackson JSON ORM
GroupId

GroupId

com.github.hronom
ArtifactId

ArtifactId

jackson-dataformat-rison
Last Version

Last Version

2.9.0
Release Date

Release Date

Type

Type

jar
Description

Description

Jackson-dataformat-Rison
Support for reading and writing Rison-encoded data via Jackson abstractions.
Project URL

Project URL

https://github.com/Hronom/jackson-dataformat-rison
Source Code Management

Source Code Management

https://github.com/Hronom/jackson-dataformat-rison

Download jackson-dataformat-rison

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.hronom/jackson-dataformat-rison/ -->
<dependency>
    <groupId>com.github.hronom</groupId>
    <artifactId>jackson-dataformat-rison</artifactId>
    <version>2.9.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.hronom/jackson-dataformat-rison/
implementation 'com.github.hronom:jackson-dataformat-rison:2.9.0'
// https://jarcasting.com/artifacts/com.github.hronom/jackson-dataformat-rison/
implementation ("com.github.hronom:jackson-dataformat-rison:2.9.0")
'com.github.hronom:jackson-dataformat-rison:jar:2.9.0'
<dependency org="com.github.hronom" name="jackson-dataformat-rison" rev="2.9.0">
  <artifact name="jackson-dataformat-rison" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.hronom', module='jackson-dataformat-rison', version='2.9.0')
)
libraryDependencies += "com.github.hronom" % "jackson-dataformat-rison" % "2.9.0"
[com.github.hronom/jackson-dataformat-rison "2.9.0"]

Dependencies

compile (1)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-core jar 2.9.0

test (2)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-databind jar 2.9.0
org.testng : testng jar 6.11

Project Modules

There are no modules declared in this project.

Build Status Dependency Status codecov.io Hex.pm Join the chat at https://gitter.im/Hronom/jackson-dataformat-rison

Rison Parser and Generator for Jackson

Introduction

Alive version of project [bazaarvoice/rison] (https://github.com/bazaarvoice/rison) that supports latest version of Jackson (2.9.x).

This version is a mix of fork [maximaleshko/rison] (https://github.com/maximaleshko/rison) and solution from issue [Not compatible with latest version of Jackson] (https://github.com/bazaarvoice/rison/issues/5#issuecomment-144750890) suggested by user [fakeh] (https://github.com/fakeh)

This project needs your help! Feel free to contribute!

Description

A plugin for the [Jackson JSON Processor] (http://wiki.fasterxml.com/JacksonHome) that adds support for reading and writing JSON objects in the [Rison] (https://github.com/Nanonid/rison) serialization format.

Rison expresses the exact same data structures as JSON, but is much more compact and readable than JSON when encoded in a URI.

See [Rison] (https://github.com/Nanonid/rison) for more information about Rison.

Maven dependency

To use in Maven-based projects, use following dependency:

<dependency>
    <groupId>com.github.hronom</groupId>
    <artifactId>jackson-dataformat-rison</artifactId>
    <version>2.9.0</version>
</dependency>

Usage

In your code, create a RisonFactory instead of a JsonFactory. Then read and write objects just as you do regular JSON objects. All the Jackson mapper facilities are available with Rison.

import com.github.hronom.jackson.dataformat.rison.RisonFactory;

String string = "(a:0,b:foo,c:'23skidoo')";
Map map = RISON.readValue(string, Map.class);
...
RISON.writeValueAsString(map);

O-Rison

If you know the value you wish to serialize is always an object, you can configure the RisonFactory to omit the containing ( and ) characters.

ObjectMapper O_RISON = new ObjectMapper(
    new RisonFactory().
    enable(RisonGenerator.Feature.O_RISON).
    enable(RisonParser.Feature.O_RISON));

String string = "a:0,b:foo,c:'23skidoo'";
Map map = O_RISON.readValue(string, Map.class);
...
System.out.println(O_RISON.writeValueAsString(map));

A-Rison

If you know the value you wish to serialize is always an array, you can configure the RisonFactory to omit the containing !( and ) characters.

ObjectMapper A_RISON = new ObjectMapper(new RisonFactory().
    enable(RisonGenerator.Feature.A_RISON).
    enable(RisonParser.Feature.A_RISON));

String string = "item1,item2,item3";
List list = A_RISON.readValue(string, List.class);
...
System.out.println(A_RISON.writeValueAsString(list));

Other Implementations

See the [Rison] (https://github.com/Nanonid/rison) page for implementations in JavaScript, Python and Ruby.

Versions

Version
2.9.0
2.8.10
2.8.9
2.8.8
2.8.7
2.8.6
2.8.5
2.8.4
2.8.3
2.8.2
2.8.1
2.8.0
2.7.6
2.7.5
2.7.4
2.7.3