Skip to content

Commit

Permalink
First pass at JSON-B (#158)
Browse files Browse the repository at this point in the history
Fixed feedback

Signed-off-by: Guillermo González de Agüero <z06.guillermo@gmail.com>
  • Loading branch information
ggam authored and bshannon committed Sep 13, 2019
1 parent 369cea7 commit 11db6b8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
10 changes: 5 additions & 5 deletions src/main/jbake/content/jsonb.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ prev=jsonp008.html
21 JSON Binding
---------------

This chapter describes the Java API for JSON Binding (JSON-B). JSON is a data exchange format widely used
This chapter describes the Jakarta JSON Binding. JSON is a data exchange format widely used
in web services and other connected applications. For a brief overview of JSON, see
link:jsonp001.html#introduction-to-json[Introduction to JSON].

The link:https://jcp.org/en/jsr/detail?id=367[JSR 367] specification provides a standard
binding layer (metadata and runtime) between Java classes and JSON documents. The JSON-B reference
The link:https://jakarta.ee/specifications/json-binding/[Jakarta JSON Binding] specification provides a standard
binding layer (metadata and runtime) between Java classes and JSON documents. One Jakarta JSON Binding reference
implementation is Yasson, which is developed through Eclipse.org and is included as part of GlassFish Server.
You can learn more about Yasson at https://projects.eclipse.org/projects/rt.yasson.
You can learn more about Yasson at https://projects.eclipse.org/projects/ee4j.yasson.

The following topics are addressed here:

* link:jsonb001.html#json-binding-in-the-jakarta-ee-platform[JSON Binding in the Jakarta EE Platform]
* link:jsonb002.html#overview-of-the-json-binding-api[Overview of the JSON Binding API]
* link:jsonb003.html#running-the-jsonbbasics-example-application[Running the jsonbbasics Example Application]
* link:jsonb004.html#further-information-about-the-java-api-for-json-binding[Further Information about the Java API for JSON Binding]
* link:jsonb004.html#further-information-about-the-java-api-for-json-binding[Further Information about Jakarta JSON Binding]
8 changes: 4 additions & 4 deletions src/main/jbake/content/jsonb001.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ prev=jsonb.html
JSON Binding in the Jakarta EE Platform
---------------------------------------

Jakarta 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:
Jakarta EE includes support for the Jakarta JSON Binding spec, which provides an API that can serialize
Java objects to JSON documents and deserialize JSON documents to Java objects.
Jakarta JSON Binding contains the following packages:

* The `javax.json.bind` package contains the binding interface, the builder interface, and
a configuration class. link:#main-classes-and-interfaces-in-bind[Table 21-1] lists the main classes
Expand Down Expand Up @@ -45,7 +45,7 @@ contains the methods that a service provider implements.
[width="99%",cols="25%,75%"]
|=======================================================================
|*Class or Interface* |*Description*
|`Jsonb` | Contains the JSON-B methods for serializing Java objects to JSON and deserailizing
|`Jsonb` | Contains the JSON binding methods for serializing Java objects to JSON and deserailizing
JSON to Java objects.

|`JsonBuilder` | Used by clients to create `Jsonb` instances.
Expand Down
10 changes: 5 additions & 5 deletions src/main/jbake/content/jsonb002.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ prev=jsonb001.html
Overview of the JSON Binding API
--------------------------------

This section provides basic instructions for using the JSON-B client API. The instructions provide a
This section provides basic instructions for using the Jakarta JSON Binding client API. The instructions provide a
basis for understanding the link:jsonb003.html[jsonbbasics Example Application].
Refer to the link:http://json-b.net/index.html[JSON-B] project page for API documentation and a more detailed
Refer to the link:http://json-b.net/index.html[Jakarta JSON Binding] project page for API documentation and a more detailed
User Guide.

The following topics are addressed here:
Expand Down Expand Up @@ -42,7 +42,7 @@ Jsonb jsonb = JsonbBuilder.create();
Using the Default Mapping
~~~~~~~~~~~~~~~~~~~~~~~~~

JSON-B provides default mappings for serializing and deserializing basic Java and Java SE types as well
Jakarta JSON Binding provides default mappings for serializing and deserializing basic Java and Java SE types as well
Java date and time classes. To use the default mappings and mapping behavior, create a josnb instance
and use the `toJson` method to serialize to JSON and the `fromJson` method to deserialize back to an
object. The following example binds a simple `Person` object that contains a single `name` field.
Expand All @@ -67,7 +67,7 @@ person = jsonb.fromJson("{name:\"joe"\"}", Person.class);
[[using-customizations]]
Using Customizations
~~~~~~~~~~~~~~~~~~~~
JSON-B supports many ways to customize the default mapping behavior. For runtime
Jakarta JSON Binding supports many ways to customize the default mapping behavior. For runtime
customizations, a `JsonbConfig` configuration object is used when creating the `jsonbinstance`. The `JsonbConfig`
class supports many configuration options and also includes advanced options for binding custom types. For
advanced options, see the `JsonbAdapter` interface and the `JsonbSerializer` and `JsonbDeserializer` interfaces.
Expand All @@ -87,7 +87,7 @@ Jsonb jsonb = JsonbBuilder.create(config);
[[using-annotations]]
Using Annotations
~~~~~~~~~~~~~~~~~
JSON-B includes many annotations that can be used at compile time to customize the default mapping behavior.
Jakarta JSON Binding includes many annotations that can be used at compile time to customize the default mapping behavior.
The following example uses the `@JsonbProperty` annotation to change the `name` field to `person-name` when
the object is serialized to JSON.

Expand Down
15 changes: 7 additions & 8 deletions src/main/jbake/content/jsonb004.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ title=JSON Binding
next=webi18n.html
prev=jsonb003.html
~~~~~~
= Further Information about the Java API for JSON Binding
= Further Information about the Jakarta JSON Binding

[[further-information-about-the-java-api-for-json-binding]]
Further Information about the Java API for JSON Binding
-------------------------------------------------------
Further Information about the Jakarta JSON Binding
--------------------------------------------------

For more information on JSON binding in Jakarta EE, see:
For more information on Jakarta JSON Binding, see:

* JSR-367: https://jcp.org/en/jsr/detail?id=367
* Specification project: http://github.com/javaee/jsonb-spec
* JSON-B official Web site: http://json-b.net
* Yasson (Reference Implementation): https://projects.eclipse.org/projects/rt.yasson
* Jakarta JSON Binding spec: https://jakarta.ee/specifications/json-binding/
* Specification project: http://github.com/eclipse-ee4j/jsonb-api
* Yasson (Implementation): https://projects.eclipse.org/projects/ee4j.yasson

0 comments on commit 11db6b8

Please sign in to comment.