relax-json

A simple jackson wrapper to simplify the interaction between java and scala.

License

License

Categories

Categories

JSON Data
GroupId

GroupId

com.infilos
ArtifactId

ArtifactId

relax-json
Last Version

Last Version

2.11.3-0
Release Date

Release Date

Type

Type

pom
Description

Description

relax-json
A simple jackson wrapper to simplify the interaction between java and scala.
Project URL

Project URL

https://github.com/infilow/relax-json
Source Code Management

Source Code Management

https://github.com/infilow/relax-json/tree/master

Download relax-json

Filename Size
relax-json-2.11.3-0.pom 7 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/com.infilos/relax-json/ -->
<dependency>
    <groupId>com.infilos</groupId>
    <artifactId>relax-json</artifactId>
    <version>2.11.3-0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.infilos/relax-json/
implementation 'com.infilos:relax-json:2.11.3-0'
// https://jarcasting.com/artifacts/com.infilos/relax-json/
implementation ("com.infilos:relax-json:2.11.3-0")
'com.infilos:relax-json:pom:2.11.3-0'
<dependency org="com.infilos" name="relax-json" rev="2.11.3-0">
  <artifact name="relax-json" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.infilos', module='relax-json', version='2.11.3-0')
)
libraryDependencies += "com.infilos" % "relax-json" % "2.11.3-0"
[com.infilos/relax-json "2.11.3-0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • relax-json-java
  • relax-json-scala

relax-json

A simple jackson wrapper to simplify the interaction between java and scala.

Jackson for only Java

<dependency>
    <groupId>com.infilos</groupId>
    <artifactId>relax-json-java</artifactId>
    <version>LATEST</version>
</dependency>

Jackson for Java with Scala support

Current supported Scala binary version is 2.12.

<dependency>
    <groupId>com.infilos</groupId>
    <artifactId>relax-json-scala</artifactId>
    <version>LATEST</version>
</dependency>

Then you can register shared module between java and scala:

JsonMappers.register(yourCustomModule)

Register serializer/deserializer instance

Jackson provide annotations @JsonSerialize/@JsonDeserialize to register custom serdes Class, but sometime you may want to register instance.

class DomainSerdes extends JsonSerdes[Domain] {
  override def onClass:Class[Domain] = classOf[Domain]
  override def serializer:JsonSerializer[Domain] = ???     /* Instance */
  override def deserializer:JsonDeserializer[Domain] = ??? /* Instance */
}

Then configure with SPI file resources/META-INF/services/com.infilos.relax.json.JsonSerdes:

com.domain.example.Doman$DomainSerdes /* Doman is a companion object */

Jackson version

Version is defined as 2.11.0-0, 2.11.0 is the jackson release version, -0 means this tookit's version.

Contributions

Version

  1. Increase build version: bash version.sh -b
  2. Change jackson release version: bash version.sh -j 2.11.0

Release

  • Snapshot: mvn clean deploy
  • Release: mvn clean package source:jar gpg:sign install:install deploy:deploy

Versions

Version
2.11.3-0
2.11.2-1
2.11.0-1