The Java EE 7 Tutorial
19.2 JSON Processing in the Java EE Platform
Java EE includes support for JSR 353, which provides an API to parse, transform, and query JSON data using the object model or the streaming model described in Generating and Parsing JSON Data. The Java API for JSON Processing contains the following packages.
-
The
javax.json
package contains a reader interface, a writer interface, and a model builder interface for the object model. This package also contains other utility classes and Java types for JSON elements. Table 19-1 lists the main classes and interfaces in this package. -
The
javax.json.stream
package contains a parser interface and a generator interface for the streaming model. Table 19-2 lists the main classes and interfaces in this package.
Table 19-1 Main Classes and Interfaces in javax.json
Class or Interface | Description |
---|---|
|
Contains static methods to create instances of JSON parsers, builders, and generators. This class also contains methods to create parser, builder, and generator factory objects. |
|
Reads JSON data from a stream and creates an object model in memory. |
|
Create an object model or an array model in memory by adding elements from application code. |
|
Writes an object model from memory to a stream. |
|
Represents an element (such as an object, an array, or a value) in JSON data. |
|
Represents an object or an array in JSON data. This interface is a subtype of |
|
Represent an object or an array in JSON data. These two interfaces are subtypes of |
|
Represent data types for elements in JSON data. These two interfaces are subtypes of |
|
Indicates that a problem occurred during JSON processing. |