/json-mystique

Utility for Json Conversion and json transformation in Java

Primary LanguageJavaApache License 2.0Apache-2.0

Build Status

Json Mystique

Utility for Json Conversion and json transformation in Java

Json mystique is a json transformation library written in and for Java. The library takes an input json as a string or jsonElement and transforms the same to a json string or JsonElement. The transformation is performed via a ruleSet file that specifies the mappings in a json format

Features and Primary Use Cases

  • The library is useful for transforming from one json to another, even when the input and output jsons are non identical
  • Multiple fields from the input can be operated on to map to a single field in the output
  • Custom converters can be easily plugged to handle custom domain logic

Dependencies

The actual versions can be found in the pom file

Maven Download

Json Mystique downloads at Maven Central

Maven Dependency Snippet

The maven dependency snippet for various libs is as below

Json Mystique - Native Library


There are three variants of JsonMystique

  • 0.x.x - All the processing of JsonMystique is sequential
  • 1.x.x - JsonMystique parallely processes various parts of the input Json
  • 2.x.x - Spring Boot compliant Json Mystique with starters and auto configuration
<dependency>
  <groupId>com.balajeetm.mystique</groupId>
  <artifactId>json-mystique</artifactId>
  <version>2.0.7</version>
</dependency>

NOTE

2.x.x is the only supported version currently. The other versions (0.x.x and 1.x.x) have been deprecated. It is highly recommended and suggested, to only use the 2.x.x versions of Mystique. Please raise issues, for support if any, on earlier versions.

There is absolutely no change in the usage or the syntax and semantics of the two versions. Moving forward, the parallel processing logic would be mainstream

Json Mystique - Spring Boot Starter


<dependency>
  <groupId>com.balajeetm.mystique</groupId>
  <artifactId>json-mystique-starter</artifactId>
  <version>2.0.7</version>
</dependency>

The json mystique spring boot starter autoconfigures the json mystique environment appropriately, creating all the necessary beans. It also appropriately configures the Jackson Object Mapper to ensure it can serialise deserialise Gson objects, iff jackson is in the classpath. In a web environment, it also configures Spring RestTemplate to ensure it can serialise deserialise Gson objects seamlessly, iff, RestTemplate is in the classpath.

For more details refer the usage guide or the sample projects for usage

Json Mystique - Gson Utilities


<dependency>
  <groupId>com.balajeetm.mystique</groupId>
  <artifactId>gson-utils</artifactId>
  <version>2.0.7</version>
</dependency>

The json mystique gson utility library provides a set of utility classes to operate on raw json objects and serialise deserialise POJOs. The utility classes are

  • Gson Convertor - Utility for POJO Object Model Mapping
  • Json Lever - Utility to operate on raw json objects. Simplified and type safe use of the Gson library. Allows deep and shallow merge of jsons
  • Json Query - Utility to perform queries on a json element (can be an object or an array)
  • Json Comparator - Utility to compare two jsons

Json Mystique - Jackson Utilities


<dependency>
  <groupId>com.balajeetm.mystique</groupId>
  <artifactId>jackson-utils</artifactId>
  <version>2.0.7</version>
</dependency>

The json mystique jackson utility library provides a set of utility classes to operate on raw json objects and serialise deserialise POJOs. The utility classes are

Hop on to the Wiki


For more information on the usage and detailed usage guides, refer the wiki