Json pretty print in Java

This tutorial wil teach you how to pretty print a Json Object using javax.json API which is part of Jakarta EE / Java EE API. By default if you run a toString() of a javax.json.JsonObject a rough output will be displayed with no formatting. By setting the property JsonGenerator.PRETTY_PRINTING into the JsonGeneratorFactory you will have … Read more

How to filter through a JSON Document using Java 8 Stream API

This tutorial will teach you how to filter through a JSON Document using Java 8 Stream API. Java 8 streams are wrappers around a data source, which allow us to operate with a data source, making bulk processing convenient and fast. A stream does not store data and, for this reason, is not a data … Read more

How to navigate and edit a JSON Document with JSON Pointer API

This tutorial will teach you how to navigate or modify a JSON Document using a JSON Pointer, which is available in javax.json API. Put it simply, a JSON Pointer is a string that references an element within a JSON document. By using a JSON pointer, an application can retrieve a value, but it can modify … Read more

How to parse JSON in Java

This tutorial provides an overview on the API available in Jakarta EE (formerly Java EE) to process and create JSON documents. There are two main APIs to handle JSON in Java: JSON-P (JSON-Processing, JSR 374): Specifies a very low-level processing library which can be carried out with two models for JSON processing. The Object Model … Read more

How to use JSON-B for parsing Java objects to/from JSON

In this tutorial we will learn about JSON-B, which is a standard binding layer for converting Java objects to/from JSON messages, included as part of JSR 367 Specification (Java EE 8). In general terms, there are two main APIs to handle JSON in Java: JSON-P (JSON-Processing, JSR 374): Specifies a very low-level processing library which … Read more

How to use JSON-P to create and parse JSON in Java

This tutorial shows how to use JSON Processing (JSR-353) API, part of the Jakarta EE specification. In general terms, there are two main APIs to handle JSON in Java: JSON-P (JSON-Processing, JSR 374): Specifies a very low-level processing library which can be carried out with two models for JSON processing: the Object Model API and the Streaming … Read more

Exit mobile version