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
- 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
- The library uses maven as its build management
- The library primarily depends on
- Spring Boot - 1.5.4.RELEASE
- Spring-Framework - 4.3.9.RELEASE for IOC and
- Gson - 22.0 for json String to Java pojo transformations
The actual versions can be found in the pom file
Json Mystique downloads at Maven Central
The maven dependency snippet for various libs is as below
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>
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
<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
<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
<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
- Jackson Convertor - Utility for POJO Object Model Mappingndency>
For more information on the usage and detailed usage guides, refer the wiki