Book Image

RESTful Java Web Services - Third Edition

By : Balachandar Bogunuva Mohanram, Jobinesh Purushothaman
Book Image

RESTful Java Web Services - Third Edition

By: Balachandar Bogunuva Mohanram, Jobinesh Purushothaman

Overview of this book

Representational State Transfer (REST) is a simple yet powerful software architecture style to create lightweight and scalable web services. The RESTful web services use HTTP as the transport protocol and can use any message formats, including XML, JSON(widely used), CSV, and many more, which makes it easily inter-operable across different languages and platforms. This successful book is currently in its 3rd edition and has been used by thousands of developers. It serves as an excellent guide for developing RESTful web services in Java. This book attempts to familiarize the reader with the concepts of REST. It is a pragmatic guide for designing and developing web services using Java APIs for real-life use cases following best practices and for learning to secure REST APIs using OAuth and JWT. Finally, you will learn the role of RESTful web services for future technological advances, be it cloud, IoT or social media. By the end of this book, you will be able to efficiently build robust, scalable, and secure RESTful web services using Java APIs.
Table of Contents (11 chapters)

Using the Jackson API for processing JSON

Jackson is a multipurpose data processing Java library. The primary capability of this tool is the support for processing JSON. It also has additional modules for processing the data encoded in other popular formats, such as Apache Avro (a data serialization system), Concise Binary Object Representation (CBOR), a binary JSON format, Smile (a binary JSON format), XML, comma-separated values (CSV), and YAML. In this section, you will learn how to use Jackson APIs to process JSON.

Jackson provides the following three methods for processing JSON:

  • Tree model APIs: This method provides APIs for building a tree representation of a JSON document
  • Data binding API: This method provides APIs for converting a JSON document into and from Java objects
  • Streaming API: This method provides streaming APIs for reading and writing a JSON document

We will...