JSON Binding (original) (raw)

Java EE includes support for JSR 367, which provides an API that can serialize Java objects to JSON documents and deserialize JSON documents to Java objects. The Java API for JSON Binding contains the following packages:

Table 21-1 Main Classes and Interfaces in javax.json.bind

Class or Interface Description
Jsonb Contains the JSON-B methods for serializing Java objects to JSON and deserailizing JSON to Java objects.
JsonBuilder Used by clients to create Jsonb instances.
JsonbConfig Used to set configuration properties on Jsonb instances. Properties include binding strategies and properties for configuring custom serializers and deserializers.
JsonbException Indicates that a problem occurred during JSON binding.

Table 21-2 Main Classes and Interfaces in javax.json.bind.config

Class or Interface Description
PropertyNamingStrategy Used to set how property names are translated.
PropertyVisibilityStrategy Used to set whether fields and methods should be considered properties overriding the default scope and field access behavior.
BinaryDataStrategy Used to set binary encoding.
PropertyOrderStrategy Used to set how properties are ordered during serialization.

Table 21-3 Main Classes and Interfaces in javax.json.bind.serializer

Class or Interface Description
JsonbDeserializer Used to create a deserialization routine for a custom type.
JsonbSerializer Used to create a serialization routine for a custom type.