commit | 89ad21536e32e7d76d78df29d04852454dacef8d | [log] [tgz] |
---|---|---|
author | Andrew Guibert <andy.guibert@gmail.com> | Wed Aug 28 12:35:18 2019 -0500 |
committer | GitHub <noreply@github.com> | Wed Aug 28 12:35:18 2019 -0500 |
tree | 8d388048da1c1ec711f76fe45e15fc59ad5ca027 | |
parent | 126a10933124f38c9ae524ddb943a73e92b8751c [diff] | |
parent | 3b3e42b32ee89236cce5ed3d304bfe8835b5e6a2 [diff] |
Merge pull request #314 from aguibert/test-doc-examples Add tests for examples shown in JSON-B documentation
Yasson is a Java framework which provides a standard binding layer between Java classes and JSON documents. This is similar to what JAXB is doing in the XML world. Yasson is an official reference implementation of JSON Binding (JSR-367).
It defines a default mapping algorithm for converting existing Java classes to JSON suitable for the most cases:
Jsonb jsonb = JsonbBuilder.create(); String result = jsonb.toJson(someObject);
For whom it's not enough it provides rich customization abilities through a set of annotations and rich programmatic API:
// Create custom configuration JsonbConfig config = new JsonbConfig() .withNullValues(true) .withFormating(true); // Create Jsonb with custom configuration Jsonb jsonb = JsonbBuilder.create(config); // Use it! String result = jsonb.toJson(someObject);