blob: c2ba2ee1f899e68787bf4137e3fa8f965378dde1 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>JsonObject</title>
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
<link rel="shortcut icon" href="/img/jakarta-favicon.ico">
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="JsonObject";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":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";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</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>
<div class="subNav">
<ul class="navList">
<li><a href="../../jakarta/json/JsonNumber.html" title="interface in jakarta.json"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../jakarta/json/JsonObjectBuilder.html" title="interface in jakarta.json"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?jakarta/json/JsonObject.html" target="_top">Frames</a></li>
<li><a href="JsonObject.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></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>
</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 name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">jakarta.json</div>
<h2 title="Interface JsonObject" class="title">Interface JsonObject</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="../../jakarta/json/JsonStructure.html" title="interface in jakarta.json">JsonStructure</a>, <a href="../../jakarta/json/JsonValue.html" title="interface in jakarta.json">JsonValue</a>, java.util.Map&lt;java.lang.String,<a href="../../jakarta/json/JsonValue.html" title="interface in jakarta.json">JsonValue</a>&gt;</dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">JsonObject</span>
extends <a href="../../jakarta/json/JsonStructure.html" title="interface in jakarta.json">JsonStructure</a>, java.util.Map&lt;java.lang.String,<a href="../../jakarta/json/JsonValue.html" title="interface in jakarta.json">JsonValue</a>&gt;</pre>
<div class="block"><code>JsonObject</code> class represents an immutable JSON object value
(an unordered collection of zero or more name/value pairs).
It also provides unmodifiable map view to the JSON object
name/value mappings.
<p>A JsonObject instance can be created from an input source using
<a href="../../jakarta/json/JsonReader.html#readObject--"><code>JsonReader.readObject()</code></a>. For example:
<pre><code>
JsonReader jsonReader = Json.createReader(...);
JsonObject object = jsonReader.readObject();
jsonReader.close();
</code></pre>
It can also be built from scratch using a <a href="../../jakarta/json/JsonObjectBuilder.html" title="interface in jakarta.json"><code>JsonObjectBuilder</code></a>.
<p>For example 1: An empty JSON object can be built as follows:
<pre><code>
JsonObject object = Json.createObjectBuilder().build();
</code></pre>
For example 2: The following JSON
<pre><code>
{
"firstName": "John", "lastName": "Smith", "age": 25,
"address" : {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021"
},
"phoneNumber": [
{ "type": "home", "number": "212 555-1234" },
{ "type": "fax", "number": "646 555-4567" }
]
}
</code></pre>
can be built using :
<pre><code>
JsonObject value = Json.createObjectBuilder()
.add("firstName", "John")
.add("lastName", "Smith")
.add("age", 25)
.add("address", Json.createObjectBuilder()
.add("streetAddress", "21 2nd Street")
.add("city", "New York")
.add("state", "NY")
.add("postalCode", "10021"))
.add("phoneNumber", Json.createArrayBuilder()
.add(Json.createObjectBuilder()
.add("type", "home")
.add("number", "212 555-1234"))
.add(Json.createObjectBuilder()
.add("type", "fax")
.add("number", "646 555-4567")))
.build();
</code></pre>
<code>JsonObject</code> can be written to JSON as follows:
<pre><code>
JsonWriter writer = ...
JsonObject obj = ...;
writer.writeObject(obj);
</code></pre>
<code>JsonObject</code> values can be <a href="../../jakarta/json/JsonObject.html" title="interface in jakarta.json"><code>JsonObject</code></a>, <a href="../../jakarta/json/JsonArray.html" title="interface in jakarta.json"><code>JsonArray</code></a>,
<a href="../../jakarta/json/JsonString.html" title="interface in jakarta.json"><code>JsonString</code></a>, <a href="../../jakarta/json/JsonNumber.html" title="interface in jakarta.json"><code>JsonNumber</code></a>, <a href="../../jakarta/json/JsonValue.html#TRUE"><code>JsonValue.TRUE</code></a>,
<a href="../../jakarta/json/JsonValue.html#FALSE"><code>JsonValue.FALSE</code></a>, <a href="../../jakarta/json/JsonValue.html#NULL"><code>JsonValue.NULL</code></a>. These values can be
accessed using various accessor methods.
<p>In the above example 2, "John" can be got using
<pre><code>
String firstName = object.getString("firstName");
</code></pre>
This map object provides read-only access to the JSON object data,
and attempts to modify the map, whether direct or via its collection
views, result in an <code>UnsupportedOperationException</code>.
<p>The map object's iteration ordering is based on the order in which
name/value pairs are added to the corresponding builder or the order
in which name/value pairs appear in the corresponding stream.</div>
<dl>
<dt><span class="simpleTagLabel">Examples (en):</span></dt>
<dd><a href="../../../../../tomee-9.0/examples/mp-metrics-timed.html">mp-metrics-timed</a>, <a href="../../../../../tomee-9.0/examples/mp-metrics-histogram.html">mp-metrics-histogram</a>, <a href="../../../../../tomee-9.0/examples/mp-metrics-gauge.html">mp-metrics-gauge</a>, <a href="../../../../../tomee-9.0/examples/mp-metrics-counted.html">mp-metrics-counted</a>, <a href="../../../../../tomee-9.0/examples/mp-custom-healthcheck.html">mp-custom-healthcheck</a>, <a href="../../../../../tomee-9.0/examples/jsonb-custom-serializer.html">jsonb-custom-serializer</a></dd>
<dt><span class="simpleTagLabel">Examples (es):</span></dt>
<dd><a href="../../../../../tomee-9.0/es/examples/mp-metrics-timed.html">mp-metrics-timed</a>, <a href="../../../../../tomee-9.0/es/examples/mp-metrics-histogram.html">mp-metrics-histogram</a>, <a href="../../../../../tomee-9.0/es/examples/mp-metrics-gauge.html">mp-metrics-gauge</a>, <a href="../../../../../tomee-9.0/es/examples/mp-metrics-counted.html">mp-metrics-counted</a>, <a href="../../../../../tomee-9.0/es/examples/mp-custom-healthcheck.html">mp-custom-healthcheck</a></dd>
<dt><span class="simpleTagLabel">Examples (pt):</span></dt>
<dd><a href="../../../../../tomee-9.0/pt/examples/mp-metrics-timed.html">mp-metrics-timed</a>, <a href="../../../../../tomee-9.0/pt/examples/mp-metrics-histogram.html">mp-metrics-histogram</a>, <a href="../../../../../tomee-9.0/pt/examples/mp-metrics-gauge.html">mp-metrics-gauge</a>, <a href="../../../../../tomee-9.0/pt/examples/mp-metrics-counted.html">mp-metrics-counted</a>, <a href="../../../../../tomee-9.0/pt/examples/mp-custom-healthcheck.html">mp-custom-healthcheck</a>, <a href="../../../../../tomee-9.0/pt/examples/jsonb-custom-serializer.html">jsonb-custom-serializer</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.jakarta.json.JsonValue">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from interface&nbsp;jakarta.json.<a href="../../jakarta/json/JsonValue.html" title="interface in jakarta.json">JsonValue</a></h3>
<code><a href="../../jakarta/json/JsonValue.ValueType.html" title="enum in jakarta.json">JsonValue.ValueType</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.java.util.Map">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from interface&nbsp;java.util.Map</h3>
<code>java.util.Map.Entry&lt;K,V&gt;</code></li>
</ul>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.jakarta.json.JsonValue">
<!-- -->
</a>
<h3>Fields inherited from interface&nbsp;jakarta.json.<a href="../../jakarta/json/JsonValue.html" title="interface in jakarta.json">JsonValue</a></h3>
<code><a href="../../jakarta/json/JsonValue.html#EMPTY_JSON_ARRAY">EMPTY_JSON_ARRAY</a>, <a href="../../jakarta/json/JsonValue.html#EMPTY_JSON_OBJECT">EMPTY_JSON_OBJECT</a>, <a href="../../jakarta/json/JsonValue.html#FALSE">FALSE</a>, <a href="../../jakarta/json/JsonValue.html#NULL">NULL</a>, <a href="../../jakarta/json/JsonValue.html#TRUE">TRUE</a></code></li>
</ul>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<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="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/json/JsonObject.html#getBoolean-java.lang.String-">getBoolean</a></span>(java.lang.String&nbsp;name)</code>
<div class="block">Returns the boolean value of the associated mapping for the specified
name.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/json/JsonObject.html#getBoolean-java.lang.String-boolean-">getBoolean</a></span>(java.lang.String&nbsp;name,
boolean&nbsp;defaultValue)</code>
<div class="block">Returns the boolean value of the associated mapping for the specified
name.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/json/JsonObject.html#getInt-java.lang.String-">getInt</a></span>(java.lang.String&nbsp;name)</code>
<div class="block">A convenience method for
<code>getJsonNumber(name).intValue()</code></div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/json/JsonObject.html#getInt-java.lang.String-int-">getInt</a></span>(java.lang.String&nbsp;name,
int&nbsp;defaultValue)</code>
<div class="block">Returns the int value of the associated <code>JsonNumber</code> mapping
for the specified name.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../jakarta/json/JsonArray.html" title="interface in jakarta.json">JsonArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/json/JsonObject.html#getJsonArray-java.lang.String-">getJsonArray</a></span>(java.lang.String&nbsp;name)</code>
<div class="block">Returns the array value to which the specified name is mapped.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../jakarta/json/JsonNumber.html" title="interface in jakarta.json">JsonNumber</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/json/JsonObject.html#getJsonNumber-java.lang.String-">getJsonNumber</a></span>(java.lang.String&nbsp;name)</code>
<div class="block">Returns the number value to which the specified name is mapped.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../jakarta/json/JsonObject.html" title="interface in jakarta.json">JsonObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/json/JsonObject.html#getJsonObject-java.lang.String-">getJsonObject</a></span>(java.lang.String&nbsp;name)</code>
<div class="block">Returns the object value to which the specified name is mapped.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../jakarta/json/JsonString.html" title="interface in jakarta.json">JsonString</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/json/JsonObject.html#getJsonString-java.lang.String-">getJsonString</a></span>(java.lang.String&nbsp;name)</code>
<div class="block">Returns the string value to which the specified name is mapped.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/json/JsonObject.html#getString-java.lang.String-">getString</a></span>(java.lang.String&nbsp;name)</code>
<div class="block">A convenience method for
<code>getJsonString(name).getString()</code></div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/json/JsonObject.html#getString-java.lang.String-java.lang.String-">getString</a></span>(java.lang.String&nbsp;name,
java.lang.String&nbsp;defaultValue)</code>
<div class="block">Returns the string value of the associated <code>JsonString</code> mapping
for the specified name.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../jakarta/json/JsonObject.html#isNull-java.lang.String-">isNull</a></span>(java.lang.String&nbsp;name)</code>
<div class="block">Returns <code>true</code> if the associated value for the specified name is
<code>JsonValue.NULL</code>.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.jakarta.json.JsonStructure">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;jakarta.json.<a href="../../jakarta/json/JsonStructure.html" title="interface in jakarta.json">JsonStructure</a></h3>
<code><a href="../../jakarta/json/JsonStructure.html#getValue-java.lang.String-">getValue</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.jakarta.json.JsonValue">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;jakarta.json.<a href="../../jakarta/json/JsonValue.html" title="interface in jakarta.json">JsonValue</a></h3>
<code><a href="../../jakarta/json/JsonValue.html#asJsonArray--">asJsonArray</a>, <a href="../../jakarta/json/JsonValue.html#asJsonObject--">asJsonObject</a>, <a href="../../jakarta/json/JsonValue.html#getValueType--">getValueType</a>, <a href="../../jakarta/json/JsonValue.html#toString--">toString</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.util.Map">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;java.util.Map</h3>
<code>clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getJsonArray-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJsonArray</h4>
<pre><a href="../../jakarta/json/JsonArray.html" title="interface in jakarta.json">JsonArray</a>&nbsp;getJsonArray(java.lang.String&nbsp;name)</pre>
<div class="block">Returns the array value to which the specified name is mapped.
This is a convenience method for <code>(JsonArray)get(name)</code> to
get the value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name whose associated value is to be returned</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the array value to which the specified name is mapped, or
<code>null</code> if this object contains no mapping for the name</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.ClassCastException</code> - if the value to which the specified name
is mapped is not assignable to JsonArray type</dd>
</dl>
</li>
</ul>
<a name="getJsonObject-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJsonObject</h4>
<pre><a href="../../jakarta/json/JsonObject.html" title="interface in jakarta.json">JsonObject</a>&nbsp;getJsonObject(java.lang.String&nbsp;name)</pre>
<div class="block">Returns the object value to which the specified name is mapped.
This is a convenience method for <code>(JsonObject)get(name)</code> to
get the value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name whose associated value is to be returned</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the object value to which the specified name is mapped, or
<code>null</code> if this object contains no mapping for the name</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.ClassCastException</code> - if the value to which the specified name
is mapped is not assignable to JsonObject type</dd>
</dl>
</li>
</ul>
<a name="getJsonNumber-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJsonNumber</h4>
<pre><a href="../../jakarta/json/JsonNumber.html" title="interface in jakarta.json">JsonNumber</a>&nbsp;getJsonNumber(java.lang.String&nbsp;name)</pre>
<div class="block">Returns the number value to which the specified name is mapped.
This is a convenience method for <code>(JsonNumber)get(name)</code> to
get the value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name whose associated value is to be returned</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number value to which the specified name is mapped, or
<code>null</code> if this object contains no mapping for the name</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.ClassCastException</code> - if the value to which the specified name
is mapped is not assignable to JsonNumber type</dd>
</dl>
</li>
</ul>
<a name="getJsonString-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJsonString</h4>
<pre><a href="../../jakarta/json/JsonString.html" title="interface in jakarta.json">JsonString</a>&nbsp;getJsonString(java.lang.String&nbsp;name)</pre>
<div class="block">Returns the string value to which the specified name is mapped.
This is a convenience method for <code>(JsonString)get(name)</code> to
get the value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name whose associated value is to be returned</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the string value to which the specified name is mapped, or
<code>null</code> if this object contains no mapping for the name</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.ClassCastException</code> - if the value to which the specified name
is mapped is not assignable to JsonString type</dd>
</dl>
</li>
</ul>
<a name="getString-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getString</h4>
<pre>java.lang.String&nbsp;getString(java.lang.String&nbsp;name)</pre>
<div class="block">A convenience method for
<code>getJsonString(name).getString()</code></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - whose associated value is to be returned as String</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the String value to which the specified name is mapped</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the specified name doesn't have any
mapping</dd>
<dd><code>java.lang.ClassCastException</code> - if the value for specified name mapping
is not assignable to JsonString</dd>
</dl>
</li>
</ul>
<a name="getString-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getString</h4>
<pre>java.lang.String&nbsp;getString(java.lang.String&nbsp;name,
java.lang.String&nbsp;defaultValue)</pre>
<div class="block">Returns the string value of the associated <code>JsonString</code> mapping
for the specified name. If <code>JsonString</code> is found, then its
<a href="../../jakarta/json/JsonString.html#getString--"><code>JsonString.getString()</code></a> is returned. Otherwise,
the specified default value is returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - whose associated value is to be returned as String</dd>
<dd><code>defaultValue</code> - a default value to be returned</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the string value of the associated mapping for the name,
or the default value</dd>
</dl>
</li>
</ul>
<a name="getInt-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInt</h4>
<pre>int&nbsp;getInt(java.lang.String&nbsp;name)</pre>
<div class="block">A convenience method for
<code>getJsonNumber(name).intValue()</code></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - whose associated value is to be returned as int</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the int value to which the specified name is mapped</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the specified name doesn't have any
mapping</dd>
<dd><code>java.lang.ClassCastException</code> - if the value for specified name mapping
is not assignable to JsonNumber</dd>
</dl>
</li>
</ul>
<a name="getInt-java.lang.String-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInt</h4>
<pre>int&nbsp;getInt(java.lang.String&nbsp;name,
int&nbsp;defaultValue)</pre>
<div class="block">Returns the int value of the associated <code>JsonNumber</code> mapping
for the specified name. If <code>JsonNumber</code> is found, then its
<a href="../../jakarta/json/JsonNumber.html#intValue--"><code>JsonNumber.intValue()</code></a> is returned. Otherwise,
the specified default value is returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - whose associated value is to be returned as int</dd>
<dd><code>defaultValue</code> - a default value to be returned</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the int value of the associated mapping for the name,
or the default value</dd>
</dl>
</li>
</ul>
<a name="getBoolean-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBoolean</h4>
<pre>boolean&nbsp;getBoolean(java.lang.String&nbsp;name)</pre>
<div class="block">Returns the boolean value of the associated mapping for the specified
name. If the associated mapping is JsonValue.TRUE, then returns true.
If the associated mapping is JsonValue.FALSE, then returns false.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - whose associated value is to be returned as boolean</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the boolean value to which the specified name is mapped</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the specified name doesn't have any
mapping</dd>
<dd><code>java.lang.ClassCastException</code> - if the value for specified name mapping
is not assignable to JsonValue.TRUE or JsonValue.FALSE</dd>
</dl>
</li>
</ul>
<a name="getBoolean-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBoolean</h4>
<pre>boolean&nbsp;getBoolean(java.lang.String&nbsp;name,
boolean&nbsp;defaultValue)</pre>
<div class="block">Returns the boolean value of the associated mapping for the specified
name. If the associated mapping is JsonValue.TRUE, then returns true.
If the associated mapping is JsonValue.FALSE, then returns false.
Otherwise, the specified default value is returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - whose associated value is to be returned as int</dd>
<dd><code>defaultValue</code> - a default value to be returned</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the boolean value of the associated mapping for the name,
or the default value</dd>
</dl>
</li>
</ul>
<a name="isNull-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isNull</h4>
<pre>boolean&nbsp;isNull(java.lang.String&nbsp;name)</pre>
<div class="block">Returns <code>true</code> if the associated value for the specified name is
<code>JsonValue.NULL</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - name whose associated value is checked</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>return true if the associated value is <code>JsonValue.NULL</code>,
otherwise false</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.NullPointerException</code> - if the specified name doesn't have any
mapping</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</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>
<div class="subNav">
<ul class="navList">
<li><a href="../../jakarta/json/JsonNumber.html" title="interface in jakarta.json"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../jakarta/json/JsonObjectBuilder.html" title="interface in jakarta.json"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?jakarta/json/JsonObject.html" target="_top">Frames</a></li>
<li><a href="JsonObject.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.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>
</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 name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>