Skip to Content
RESTful Java Web Services - Third Edition
book

RESTful Java Web Services - Third Edition

by Balachandar Bogunuva Mohanram
November 2017
Intermediate to advanced
420 pages
10h 29m
English
Packt Publishing
Content preview from RESTful Java Web Services - Third Edition

Generating the JSON representation from the object model

In the previous section, we discussed the APIs provided by JSR 353 to convert the JSON data into the Java object model. In this section, you will learn how to convert a Java object model into the JSON format, which is the opposite of the operation discussed in the previous section.

The very first step is to build an object model. You can use either of the following classes to generate the object model. The choice of the builder class depends on whether you want to generate a JSON object or a JSON array:

  • javax.json.JsonObjectBuilder: This builder class is used for generating the JSON object model from scratch. This class provides methods to add the name-value pairs to the object model ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

RESTful Java Web Services, Second Edition

RESTful Java Web Services, Second Edition

Jobinesh Purushothaman
Java Web Services

Java Web Services

David A Chappell, Tyler Jewell

Publisher Resources

ISBN: 9781788294041Supplemental Content