JAX-RS JSONB Introduction
The Java API for JSON Binding (JSON-B) provides a binding layer for converting Java objects to and from
JSON messages. JSON-B also supports the ability to customize the default mapping process used in this
binding layer through the use of Java annotations for a given field, JavaBean property,
type or package, or by providing an implementation of a property naming strategy.
Description of the Example
This sample demonstrates how to use the Java API for JSON Binding with JAX-RS.
This sample shows a JAX-RS application that produces and consumes JSON
using the Java API for JSON Binding (JSON-B).
This sample demonstrates the following key features:
- The JSON Binding API: Serialization and deserialization of object.
Use This Example
- Jsonb serialization demo
Demonstrates JSON-B serialization
- Using of default mapping
- Using customizations
- Using formatting
- Using
JsonbProperty
and JsonbNillable
annotations
- Jsonb deserialization demo
Demonstrates JSON-B deserialization and how JSON-P and JSON-B can be used together.
- Demonstrate how JSON-P and JSON-B can be used together
- Read Json document using JSON-P
- Use
JsonPointer
to get an object
- Use JSON-B to deserialize this object to POJO
- Jsonb generic deserialization demo
Demonstrates deserialization of generic list.
- Deserialize jasons.json into
List<Person>