blob: af8e84d331358867547e16b934ffbd74f35fb75c [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>JsonPointer (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="JsonPointer (JSON Processing API documentation)";
}
}
catch(err) {
}
//-->
var data = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
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><a href="../../../index.html">Overview</a></li>
<li><a href="../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/JsonPointer.html">Use</a></li>
<li><a href="package-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&nbsp;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>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="moduleLabelInType">Module</span>&nbsp;<a href="../../module-summary.html">jakarta.json</a></div>
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">jakarta.json</a></div>
<h2 title="Interface JsonPointer" class="title">Interface JsonPointer</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><code><a href="../../org/glassfish/json/JsonPointerImpl.html" title="class in org.glassfish.json">JsonPointerImpl</a></code></dd>
</dl>
<hr>
<pre>public interface <span class="typeNameLabel">JsonPointer</span></pre>
<div class="block"><p>This interface represents an immutable implementation of a JSON Pointer
as defined by <a href="http://tools.ietf.org/html/rfc6901">RFC 6901</a>.
</p>
<p> A JSON Pointer, when applied to a target <a href="JsonValue.html" title="interface in jakarta.json"><code>JsonValue</code></a>,
defines a reference location in the target.</p>
<p> An empty JSON Pointer string defines a reference to the target itself.</p>
<p> If the JSON Pointer string is non-empty, it must be a sequence
of '/' prefixed tokens, and the target must either be a <a href="JsonArray.html" title="interface in jakarta.json"><code>JsonArray</code></a>
or <a href="JsonObject.html" title="interface in jakarta.json"><code>JsonObject</code></a>. If the target is a <code>JsonArray</code>, the pointer
defines a reference to an array element, and the last token specifies the index.
If the target is a <a href="JsonObject.html" title="interface in jakarta.json"><code>JsonObject</code></a>, the pointer defines a reference to a
name/value pair, and the last token specifies the name.
</p>
<p> The method <a href="#getValue(jakarta.json.JsonStructure)"><code>getValue()</code></a> returns the referenced value.
Methods <a href="#add(T,jakarta.json.JsonValue)"><code>add()</code></a>, <a href="#replace(T,jakarta.json.JsonValue)"><code>replace()</code></a>,
and <a href="#remove(T)"><code>remove()</code></a> execute operations specified in
<a href="http://tools.ietf.org/html/rfc6902">RFC 6902</a>. </p></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="http://tools.ietf.org/html/rfc6901">RFC 6901</a>,
<a href="http://tools.ietf.org/html/rfc6902">RFC 6902</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>&lt;T extends <a href="JsonStructure.html" title="interface in jakarta.json">JsonStructure</a>&gt;<br>T</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#add(T,jakarta.json.JsonValue)">add</a></span>&#8203;(T&nbsp;target,
<a href="JsonValue.html" title="interface in jakarta.json">JsonValue</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Adds or replaces a value at the referenced location in the specified
<code>target</code> with the specified <code>value</code>.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#containsValue(jakarta.json.JsonStructure)">containsValue</a></span>&#8203;(<a href="JsonStructure.html" title="interface in jakarta.json">JsonStructure</a>&nbsp;target)</code></th>
<td class="colLast">
<div class="block">Returns <code>true</code> if there is a value at the referenced location in the specified <code>target</code>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="JsonValue.html" title="interface in jakarta.json">JsonValue</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getValue(jakarta.json.JsonStructure)">getValue</a></span>&#8203;(<a href="JsonStructure.html" title="interface in jakarta.json">JsonStructure</a>&nbsp;target)</code></th>
<td class="colLast">
<div class="block">Returns the value at the referenced location in the specified <code>target</code>.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>&lt;T extends <a href="JsonStructure.html" title="interface in jakarta.json">JsonStructure</a>&gt;<br>T</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#remove(T)">remove</a></span>&#8203;(T&nbsp;target)</code></th>
<td class="colLast">
<div class="block">Removes the value at the reference location in the specified <code>target</code>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>&lt;T extends <a href="JsonStructure.html" title="interface in jakarta.json">JsonStructure</a>&gt;<br>T</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#replace(T,jakarta.json.JsonValue)">replace</a></span>&#8203;(T&nbsp;target,
<a href="JsonValue.html" title="interface in jakarta.json">JsonValue</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Replaces the value at the referenced location in the specified
<code>target</code> with the specified <code>value</code>.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the string representation of this JSON Pointer.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="add(jakarta.json.JsonStructure,jakarta.json.JsonValue)">
<!-- -->
</a><a id="add(T,jakarta.json.JsonValue)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre class="methodSignature">&lt;T extends <a href="JsonStructure.html" title="interface in jakarta.json">JsonStructure</a>&gt;&nbsp;T&nbsp;add&#8203;(T&nbsp;target,
<a href="JsonValue.html" title="interface in jakarta.json">JsonValue</a>&nbsp;value)</pre>
<div class="block">Adds or replaces a value at the referenced location in the specified
<code>target</code> with the specified <code>value</code>.
<ol>
<li>If the reference is the target (empty JSON Pointer string),
the specified <code>value</code>, which must be the same type as
specified <code>target</code>, is returned.</li>
<li>If the reference is an array element, the specified <code>value</code> is inserted
into the array, at the referenced index. The value currently at that location, and
any subsequent values, are shifted to the right (adds one to the indices).
Index starts with 0. If the reference is specified with a "-", or if the
index is equal to the size of the array, the value is appended to the array.</li>
<li>If the reference is a name/value pair of a <code>JsonObject</code>, and the
referenced value exists, the value is replaced by the specified <code>value</code>.
If the value does not exist, a new name/value pair is added to the object.</li>
</ol></div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - the target type, must be a subtype of <a href="JsonValue.html" title="interface in jakarta.json"><code>JsonValue</code></a></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>target</code> - the target referenced by this <code>JsonPointer</code></dd>
<dd><code>value</code> - the value to be added</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the transformed <code>target</code> after the value is added.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NullPointerException</a></code> - if <code>target</code> is <code>null</code></dd>
<dd><code><a href="JsonException.html" title="class in jakarta.json">JsonException</a></code> - if the reference is an array element and
the index is out of range (<code>index &lt; 0 || index &gt; array size</code>),
or if the pointer contains references to non-existing objects or arrays.</dd>
</dl>
</li>
</ul>
<a id="remove(jakarta.json.JsonStructure)">
<!-- -->
</a><a id="remove(T)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>remove</h4>
<pre class="methodSignature">&lt;T extends <a href="JsonStructure.html" title="interface in jakarta.json">JsonStructure</a>&gt;&nbsp;T&nbsp;remove&#8203;(T&nbsp;target)</pre>
<div class="block">Removes the value at the reference location in the specified <code>target</code>.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - the target type, must be a subtype of <a href="JsonValue.html" title="interface in jakarta.json"><code>JsonValue</code></a></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>target</code> - the target referenced by this <code>JsonPointer</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the transformed <code>target</code> after the value is removed.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NullPointerException</a></code> - if <code>target</code> is <code>null</code></dd>
<dd><code><a href="JsonException.html" title="class in jakarta.json">JsonException</a></code> - if the referenced value does not exist,
or if the reference is the target.</dd>
</dl>
</li>
</ul>
<a id="replace(jakarta.json.JsonStructure,jakarta.json.JsonValue)">
<!-- -->
</a><a id="replace(T,jakarta.json.JsonValue)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>replace</h4>
<pre class="methodSignature">&lt;T extends <a href="JsonStructure.html" title="interface in jakarta.json">JsonStructure</a>&gt;&nbsp;T&nbsp;replace&#8203;(T&nbsp;target,
<a href="JsonValue.html" title="interface in jakarta.json">JsonValue</a>&nbsp;value)</pre>
<div class="block">Replaces the value at the referenced location in the specified
<code>target</code> with the specified <code>value</code>.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - the target type, must be a subtype of <a href="JsonValue.html" title="interface in jakarta.json"><code>JsonValue</code></a></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>target</code> - the target referenced by this <code>JsonPointer</code></dd>
<dd><code>value</code> - the value to be stored at the referenced location</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the transformed <code>target</code> after the value is replaced.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NullPointerException</a></code> - if <code>target</code> is <code>null</code></dd>
<dd><code><a href="JsonException.html" title="class in jakarta.json">JsonException</a></code> - if the referenced value does not exist,
or if the reference is the target.</dd>
</dl>
</li>
</ul>
<a id="containsValue(jakarta.json.JsonStructure)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>containsValue</h4>
<pre class="methodSignature">boolean&nbsp;containsValue&#8203;(<a href="JsonStructure.html" title="interface in jakarta.json">JsonStructure</a>&nbsp;target)</pre>
<div class="block">Returns <code>true</code> if there is a value at the referenced location in the specified <code>target</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>target</code> - the target referenced by this <code>JsonPointer</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if this pointer points to a value in a specified <code>target</code>.</dd>
</dl>
</li>
</ul>
<a id="getValue(jakarta.json.JsonStructure)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue</h4>
<pre class="methodSignature"><a href="JsonValue.html" title="interface in jakarta.json">JsonValue</a>&nbsp;getValue&#8203;(<a href="JsonStructure.html" title="interface in jakarta.json">JsonStructure</a>&nbsp;target)</pre>
<div class="block">Returns the value at the referenced location in the specified <code>target</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>target</code> - the target referenced by this <code>JsonPointer</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the referenced value in the target.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang" class="externalLink">NullPointerException</a></code> - if <code>target</code> is null</dd>
<dd><code><a href="JsonException.html" title="class in jakarta.json">JsonException</a></code> - if the referenced value does not exist</dd>
</dl>
</li>
</ul>
<a id="toString()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre class="methodSignature"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;toString()</pre>
<div class="block">Returns the string representation of this JSON Pointer.
The value to be returned is an empty string or a sequence of '<code>/</code>' prefixed tokens.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the valid escaped JSON Pointer string.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<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><a href="../../../index.html">Overview</a></li>
<li><a href="../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/JsonPointer.html">Use</a></li>
<li><a href="package-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&nbsp;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>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</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 &#169; 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>