| <!DOCTYPE HTML> | |
| <!-- NewPage --> | |
| <html lang="en"> | |
| <head> | |
| <!-- Generated by javadoc --> | |
| <title>Overview (JSON Processing API documentation)</title> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> | |
| <link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style"> | |
| <script type="text/javascript" src="script.js"></script> | |
| <script type="text/javascript" src="jquery/jszip/dist/jszip.min.js"></script> | |
| <script type="text/javascript" src="jquery/jszip-utils/dist/jszip-utils.min.js"></script> | |
| <!--[if IE]> | |
| <script type="text/javascript" src="jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> | |
| <![endif]--> | |
| <script type="text/javascript" src="jquery/jquery-3.3.1.js"></script> | |
| <script type="text/javascript" src="jquery/jquery-migrate-3.0.1.js"></script> | |
| <script type="text/javascript" src="jquery/jquery-ui.js"></script> | |
| </head> | |
| <body> | |
| <script type="text/javascript"><!-- | |
| try { | |
| if (location.href.indexOf('is-external=true') == -1) { | |
| parent.document.title="Overview (JSON Processing API documentation)"; | |
| } | |
| } | |
| catch(err) { | |
| } | |
| //--> | |
| var pathtoroot = "./"; | |
| var useModuleDirectories = true; | |
| loadScripts(document, 'script');</script> | |
| <noscript> | |
| <div>JavaScript is disabled on your browser.</div> | |
| </noscript> | |
| <header role="banner"> | |
| <nav role="navigation"> | |
| <div class="fixedNav"> | |
| <!-- ========= START OF TOP NAVBAR ======= --> | |
| <div class="topNav"><a id="navbar.top"> | |
| <!-- --> | |
| </a> | |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> | |
| <a id="navbar.top.firstrow"> | |
| <!-- --> | |
| </a> | |
| <ul class="navList" title="Navigation"> | |
| <li class="navBarCell1Rev">Overview</li> | |
| <li><a href="jakarta.json/module-summary.html">Module</a></li> | |
| <li>Package</li> | |
| <li>Class</li> | |
| <li>Use</li> | |
| <li><a href="overview-tree.html">Tree</a></li> | |
| <li><a href="deprecated-list.html">Deprecated</a></li> | |
| <li><a href="index-all.html">Index</a></li> | |
| <li><a href="help-doc.html">Help</a></li> | |
| </ul> | |
| <div class="aboutLanguage"><br>JSON Processing API v2.0.0</div> | |
| </div> | |
| <div class="subNav"> | |
| <ul class="navList" id="allclasses_navbar_top"> | |
| <li><a href="allclasses.html">All Classes</a></li> | |
| </ul> | |
| <ul class="navListSearch"> | |
| <li><label for="search">SEARCH:</label> | |
| <input type="text" id="search" value="search" disabled="disabled"> | |
| <input type="reset" id="reset" value="reset" disabled="disabled"> | |
| </li> | |
| </ul> | |
| <div> | |
| <script type="text/javascript"><!-- | |
| allClassesLink = document.getElementById("allclasses_navbar_top"); | |
| if(window==top) { | |
| allClassesLink.style.display = "block"; | |
| } | |
| else { | |
| allClassesLink.style.display = "none"; | |
| } | |
| //--> | |
| </script> | |
| <noscript> | |
| <div>JavaScript is disabled on your browser.</div> | |
| </noscript> | |
| </div> | |
| <a id="skip.navbar.top"> | |
| <!-- --> | |
| </a></div> | |
| <!-- ========= END OF TOP NAVBAR ========= --> | |
| </div> | |
| <div class="navPadding"> </div> | |
| <script type="text/javascript"><!-- | |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); | |
| //--> | |
| </script> | |
| </nav> | |
| </header> | |
| <div class="header"> | |
| <h1 class="title">JSON Processing API documentation</h1> | |
| </div> | |
| <main role="main"> | |
| <div class="contentContainer"> | |
| <div class="block">Jakarta JSON Processing provides portable APIs to parse, | |
| generate, transform, and query <a href="http://json.org/">JSON</a> using the | |
| streaming API or the object model API. | |
| <p>The Streaming API provides a way to parsing and generation of JSON in a | |
| streaming fashion. It hands over parsing and generation control to the | |
| programmer. The streaming API provides an event-based parser and allows an | |
| application developer to ask for the next event rather than handling the event | |
| in a callback. This gives a developer more procedural control over | |
| the processing of the JSON. Application code can process or discard | |
| the parser event, and ask for the next event(pull the event). The | |
| streaming model is adequate for local processing where random access of other | |
| parts of the data is not required. Similarly, the streaming API provides | |
| a way to generate well-formed JSON to a stream by writing one event at a time. | |
| <p>The object model API creates a random access tree-like structure that | |
| represents the JSON data in memory. The tree can then be navigated and | |
| queried. This programming model is the most flexible and enables processing | |
| that requires random access to the complete contents of the tree. However, | |
| it is often not as efficient as the streaming model and requires more memory. | |
| The object model generates JSON output by navigating the entire tree at once. | |
| <h1>The Streaming API</h1> | |
| <p>The streaming API is similar to the StAX API for XML and consists of the | |
| interfaces <a href="jakarta.json/jakarta/json/stream/JsonParser.html" title="interface in jakarta.json.stream"><code>JsonParser</code></a> and | |
| <a href="jakarta.json/jakarta/json/stream/JsonGenerator.html" title="interface in jakarta.json.stream"><code>JsonGenerator</code></a>. <code>JsonParser</code> | |
| contains methods to parse JSON data using the streaming model. | |
| <code>JsonGenerator</code> contains methods to write JSON data to an ouptut source. | |
| <p><code>JsonParser</code> provides forward, read-only access to | |
| JSON data using the pull parsing programming model. In this model the | |
| application code controls the thread and calls methods in the parser interface | |
| to move the parser forward or to obtain JSON data from the current state of | |
| the parser. Refer to | |
| <a href="jakarta/json/stream/JsonParser.html#JsonParserExample2">this example</a> | |
| for more details. | |
| <p><code>JsonGenerator</code> provides methods to write JSON to a stream. The | |
| generator writes name/value pairs in JSON objects and values in JSON arrays. | |
| Refer to | |
| <a href="jakarta/json/stream/JsonGenerator.html#JsonGeneratorExample3">this | |
| example</a> for more details. | |
| <p>The streaming API is a low-level API designed to process large amounts of | |
| JSON data efficiently. Other JSON frameworks (such as JSON binding) can be | |
| implemented using this API.</p> | |
| <h1>The Object Model API</h1> | |
| <p>The object model API is similar to the DOM API for XML. It is a high-level | |
| API that provides immutable object models for JSON object and array structures. | |
| These JSON structures are represented as object models using the Java types | |
| <a href="jakarta.json/jakarta/json/JsonObject.html" title="interface in jakarta.json"><code>JsonObject</code></a> and <a href="jakarta.json/jakarta/json/JsonArray.html" title="interface in jakarta.json"><code>JsonArray</code></a>. | |
| <code>JsonObject</code> provides a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>Map</code></a> view to access the unordered | |
| collection of zero or more name/value pairs from the model. Similarly, | |
| <code>JsonArray</code> provides a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>List</code></a> view to access the ordered | |
| sequence of zero or more values from the model. | |
| <p>The object model API uses builder patterns to create these object models. | |
| Application code can use the interface <a href="jakarta.json/jakarta/json/JsonObjectBuilder.html" title="interface in jakarta.json"><code>JsonObjectBuilder</code></a> | |
| to create models that represent JSON objects. The resulting model is of type | |
| <code>JsonObject</code>. Refer to | |
| <a href="jakarta/json/JsonObjectBuilder.html#JsonObjectBuilderExample1">this example</a> | |
| for more details. Application code can use the interface | |
| <a href="jakarta.json/jakarta/json/JsonArrayBuilder.html" title="interface in jakarta.json"><code>JsonArrayBuilder</code></a> to create models that represent JSON arrays. | |
| The resulting model is of type <code>JsonArray</code>. Refer to | |
| <a href="jakarta/json/JsonArrayBuilder.html#JsonArrayBuilderExample1">this example</a> | |
| for more details. | |
| <p>These object models can also be created from an input source (such as | |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/InputStream.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>InputStream</code></a> or <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Reader.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Reader</code></a>) using the interface | |
| <a href="jakarta.json/jakarta/json/JsonReader.html" title="interface in jakarta.json"><code>JsonReader</code></a>. | |
| <a href="jakarta/json/JsonReader.html#JsonReaderExample1">This example</a> shows | |
| how to read and create an empty <code>JsonArray</code> model using the interface | |
| <code>JsonReader</code>. Similarly, these object models can be written to an output | |
| source (such as <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/OutputStream.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>OutputStream</code></a> or <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Writer.html?is-external=true" title="class or interface in java.io" class="externalLink"><code>Writer</code></a>) using | |
| the class <a href="jakarta.json/jakarta/json/JsonWriter.html" title="interface in jakarta.json"><code>JsonWriter</code></a>. | |
| <a href="jakarta/json/JsonWriter.html#JsonWriterExample1">This example</a> shows | |
| how to write an empty <code>JsonObject</code> model using the interface | |
| <code>JsonWriter</code>. | |
| <h1>JSON Pointer, JSON Patch, and JSON Merge Patch</h1> | |
| Jakarta JSON Processing supports the latest standard on | |
| <a href="http://tools.ietf.org/html/rfc6901">JSON Pointer</a>, | |
| <a Href="http://tools.ietf.org/html/rfc6902">JSON Patch</a>, and | |
| <a Href="http://tools.ietf.org/html/rfc7396">JSON Merge Patch</a>.</div> | |
| </div> | |
| <div class="contentContainer"> | |
| <table class="overviewSummary"> | |
| <caption><span>Modules</span><span class="tabEnd"> </span></caption> | |
| <tr> | |
| <th class="colFirst" scope="col">Module</th> | |
| <th class="colLast" scope="col">Description</th> | |
| </tr> | |
| <tbody> | |
| <tr class="altColor" id="i0"> | |
| <th class="colFirst" scope="row"><a href="jakarta.json/module-summary.html">jakarta.json</a></th> | |
| <td class="colLast"> | |
| <div class="block">Jakarta JSON Processing API.</div> | |
| </td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| </div> | |
| </main> | |
| <footer role="contentinfo"> | |
| <nav role="navigation"> | |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> | |
| <div class="bottomNav"><a id="navbar.bottom"> | |
| <!-- --> | |
| </a> | |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> | |
| <a id="navbar.bottom.firstrow"> | |
| <!-- --> | |
| </a> | |
| <ul class="navList" title="Navigation"> | |
| <li class="navBarCell1Rev">Overview</li> | |
| <li><a href="jakarta.json/module-summary.html">Module</a></li> | |
| <li>Package</li> | |
| <li>Class</li> | |
| <li>Use</li> | |
| <li><a href="overview-tree.html">Tree</a></li> | |
| <li><a href="deprecated-list.html">Deprecated</a></li> | |
| <li><a href="index-all.html">Index</a></li> | |
| <li><a href="help-doc.html">Help</a></li> | |
| </ul> | |
| <div class="aboutLanguage"><br>JSON Processing API v2.0.0</div> | |
| </div> | |
| <div class="subNav"> | |
| <ul class="navList" id="allclasses_navbar_bottom"> | |
| <li><a href="allclasses.html">All Classes</a></li> | |
| </ul> | |
| <div> | |
| <script type="text/javascript"><!-- | |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); | |
| if(window==top) { | |
| allClassesLink.style.display = "block"; | |
| } | |
| else { | |
| allClassesLink.style.display = "none"; | |
| } | |
| //--> | |
| </script> | |
| <noscript> | |
| <div>JavaScript is disabled on your browser.</div> | |
| </noscript> | |
| </div> | |
| <a id="skip.navbar.bottom"> | |
| <!-- --> | |
| </a></div> | |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> | |
| </nav> | |
| <p class="legalCopy"><small>Comments to: <a href="mailto:jsonp-dev@eclipse.org">jsonp-dev@eclipse.org</a>.<br> Copyright © 2019, 2020 Eclipse Foundation. All rights reserved.<br> Use is subject to <a href="./doc-files/speclicense.html" target="_top">license terms</a>.</small></p> | |
| </footer> | |
| </body> | |
| </html> |