Using the JSR 367 – Java API for JSON Binding

Similar to JAXB for XML processing, the JSR 367: Java API for JSON Binding (JSON-B) defines the binding layer for transforming Java objects to JSON messages and vice-versa, as depicted ahead:

Now let's look at the key components of JSON-B:

Class or Interface

Description

javax.json.bind.Jsonb

This is the core API that provides the functions to serialize a Java object to JSON and deserialize to Java object from a JSON input.

javax.json.bind.JsonbConfig

This class provides functions for formatting and encoding to create customized JSON data.

javax.json.bind.JsonbBuilder

As ...

Get RESTful Java Web Services - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.