blob: 417a3a368c98601047e6ee5fcffcd1568d829769 [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>Jsonb</title>
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Jsonb";
}
}
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,"i11":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>Prev&nbsp;Class</li>
<li><a href="../../../javax/json/bind/JsonbBuilder.html" title="interface in javax.json.bind"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/json/bind/Jsonb.html" target="_top">Frames</a></li>
<li><a href="Jsonb.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">javax.json.bind</div>
<h2 title="Interface Jsonb" class="title">Interface Jsonb</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd>java.lang.AutoCloseable</dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">Jsonb</span>
extends java.lang.AutoCloseable</pre>
<div class="block"><p><code>Jsonb</code> provides an abstraction over the JSON Binding framework operations:</p>
<ul>
<li><code>fromJson</code>: read JSON input, deserialize to Java objects content tree
<li><code>toJson</code>: serialize Java objects content tree to JSON input
</ul>
<p>Instance of this class is created using <a href="../../../javax/json/bind/JsonbBuilder.html" title="interface in javax.json.bind"><code>JsonbBuilder</code></a>
builder methods:</p>
<pre><code>
// Example 1 - Creating Jsonb using default JsonbBuilder instance provided by default JsonbProvider
Jsonb jsonb = JsonbBuilder.create();
// Example 2 - Creating Jsonb instance for a specific provider specified by a class name
Jsonb jsonb = JsonbBuilder.newBuilder("foo.bar.ProviderImpl).build();
// Example 3 - Creating Jsonb instance from a custom provider implementation
Jsonb jsonb = new CustomJsonbBuilder().build();
</code></pre>
<b>Deserializing (reading) JSON</b><br>
<blockquote>
Can de-serialize JSON data that represents either an entire JSON
document or a subtree of a JSON document.
</blockquote>
<blockquote>
Reading (deserializing) object content tree from a File:<br><br>
<pre>
Jsonb jsonb = JsonbBuilder.create();
Book book = jsonb.fromJson(new FileReader("jsonfile.json"), Book.class);</pre>
If the deserialization process is unable to deserialize the JSON content to an object
content tree, fatal error is reported that terminates processing by
throwing JsonbException.
</blockquote>
<p><b>Serializing (writing) to JSON</b></p>
<blockquote>
Serialization writes the representation of a Java object content tree into
JSON data.
</blockquote>
<blockquote>
Writing (serializing) object content tree to a File:<br><br>
<pre>
jsonb.toJson(object, new FileWriter("foo.json"));</pre>
Writing (serializing) to a Writer:<br><br>
<pre>
jsonb.toJson(object, new PrintWriter(System.out));
</pre>
</blockquote>
<p><b>Encoding</b></p>
<blockquote>
In deserialization operations (<code>fromJson</code>), encoding of JSON data is detected automatically.
Use the <a href="../../../javax/json/bind/JsonbConfig.html" title="class in javax.json.bind"><code>JsonbConfig</code></a> API to configure expected
input encoding used within deserialization operations. Client applications are
expected to supply a valid character encoding as defined in the
<a href="http://tools.ietf.org/html/rfc7159">RFC 7159</a> and supported by Java Platform.
In serialization operations (<code>toJson</code>), UTF-8 encoding is used by default
for writing JSON data.
Use the <a href="../../../javax/json/bind/JsonbConfig.html" title="class in javax.json.bind"><code>JsonbConfig</code></a> API to configure the
output encoding used within serialization operations. Client applications are
expected to supply a valid character encoding as defined in the
<a href="http://tools.ietf.org/html/rfc7159">RFC 7159</a> and supported by Java Platform.
</blockquote>
<p>For optimal use, <code>JsonbBuilder</code> and <code>Jsonb</code> instances should be
reused - for a typical use-case, only one <code>Jsonb</code> instance is
required by an application.</p>
<p>All the methods in this class are safe for use by multiple concurrent threads.</p>
<p>Calling <code>Closable.close()</code> method will cleanup all CDI managed components
(such as adapters with CDI dependencies) created during interaction with Jsonb.
Calling <code>close()</code> must be done after all threads has finished interaction with Jsonb.
If there are remaining threads working with Jsonb and <code>close()</code> is called, behaviour is undefined.
</p></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>JSON Binding 1.0</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../javax/json/bind/Jsonb.html" title="interface in javax.json.bind"><code>Jsonb</code></a>,
<a href="../../../javax/json/bind/JsonbBuilder.html" title="interface in javax.json.bind"><code>JsonbBuilder</code></a>,
<code>ServiceLoader</code></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== 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>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/bind/Jsonb.html#fromJson-java.io.InputStream-java.lang.Class-">fromJson</a></span>(java.io.InputStream&nbsp;stream,
java.lang.Class&lt;T&gt;&nbsp;type)</code>
<div class="block">Reads in a JSON data from the specified InputStream and return the
resulting content tree.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/bind/Jsonb.html#fromJson-java.io.InputStream-java.lang.reflect.Type-">fromJson</a></span>(java.io.InputStream&nbsp;stream,
java.lang.reflect.Type&nbsp;runtimeType)</code>
<div class="block">Reads in a JSON data from the specified InputStream and return the
resulting content tree.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/bind/Jsonb.html#fromJson-java.io.Reader-java.lang.Class-">fromJson</a></span>(java.io.Reader&nbsp;reader,
java.lang.Class&lt;T&gt;&nbsp;type)</code>
<div class="block">Reads in a JSON data from the specified Reader and return the
resulting content tree.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/bind/Jsonb.html#fromJson-java.io.Reader-java.lang.reflect.Type-">fromJson</a></span>(java.io.Reader&nbsp;reader,
java.lang.reflect.Type&nbsp;runtimeType)</code>
<div class="block">Reads in a JSON data from the specified Reader and return the
resulting content tree.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/bind/Jsonb.html#fromJson-java.lang.String-java.lang.Class-">fromJson</a></span>(java.lang.String&nbsp;str,
java.lang.Class&lt;T&gt;&nbsp;type)</code>
<div class="block">Reads in a JSON data from the specified string and return the resulting
content tree.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/bind/Jsonb.html#fromJson-java.lang.String-java.lang.reflect.Type-">fromJson</a></span>(java.lang.String&nbsp;str,
java.lang.reflect.Type&nbsp;runtimeType)</code>
<div class="block">Reads in a JSON data from the specified string and return the resulting
content tree.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/bind/Jsonb.html#toJson-java.lang.Object-">toJson</a></span>(java.lang.Object&nbsp;object)</code>
<div class="block">Writes the Java object tree with root object <code>object</code> to a String
instance as JSON.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/bind/Jsonb.html#toJson-java.lang.Object-java.io.OutputStream-">toJson</a></span>(java.lang.Object&nbsp;object,
java.io.OutputStream&nbsp;stream)</code>
<div class="block">Writes the object content tree into output stream.</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="../../../javax/json/bind/Jsonb.html#toJson-java.lang.Object-java.lang.reflect.Type-">toJson</a></span>(java.lang.Object&nbsp;object,
java.lang.reflect.Type&nbsp;runtimeType)</code>
<div class="block">Writes the Java object tree with root object <code>object</code> to a String
instance as JSON.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/bind/Jsonb.html#toJson-java.lang.Object-java.lang.reflect.Type-java.io.OutputStream-">toJson</a></span>(java.lang.Object&nbsp;object,
java.lang.reflect.Type&nbsp;runtimeType,
java.io.OutputStream&nbsp;stream)</code>
<div class="block">Writes the object content tree into output stream.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/bind/Jsonb.html#toJson-java.lang.Object-java.lang.reflect.Type-java.io.Writer-">toJson</a></span>(java.lang.Object&nbsp;object,
java.lang.reflect.Type&nbsp;runtimeType,
java.io.Writer&nbsp;writer)</code>
<div class="block">Writes the object content tree into a Writer character stream.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/bind/Jsonb.html#toJson-java.lang.Object-java.io.Writer-">toJson</a></span>(java.lang.Object&nbsp;object,
java.io.Writer&nbsp;writer)</code>
<div class="block">Writes the object content tree into a Writer character stream.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.AutoCloseable">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;java.lang.AutoCloseable</h3>
<code>close</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="fromJson-java.lang.String-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromJson</h4>
<pre>&lt;T&gt;&nbsp;T&nbsp;fromJson(java.lang.String&nbsp;str,
java.lang.Class&lt;T&gt;&nbsp;type)
throws <a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></pre>
<div class="block">Reads in a JSON data from the specified string and return the resulting
content tree.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - Type of the content tree's root object.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>str</code> - The string to deserialize JSON data from.</dd>
<dd><code>type</code> - Type of the content tree's root object.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the newly created root object of the java content tree</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></code> - If any unexpected error(s) occur(s) during deserialization.</dd>
<dd><code>java.lang.NullPointerException</code> - If any of the parameters is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="fromJson-java.lang.String-java.lang.reflect.Type-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromJson</h4>
<pre>&lt;T&gt;&nbsp;T&nbsp;fromJson(java.lang.String&nbsp;str,
java.lang.reflect.Type&nbsp;runtimeType)
throws <a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></pre>
<div class="block">Reads in a JSON data from the specified string and return the resulting
content tree.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - Type of the content tree's root object.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>str</code> - The string to deserialize JSON data from.</dd>
<dd><code>runtimeType</code> - Runtime type of the content tree's root object.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the newly created root object of the java content tree</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></code> - If any unexpected error(s) occur(s) during deserialization.</dd>
<dd><code>java.lang.NullPointerException</code> - If any of the parameters is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="fromJson-java.io.Reader-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromJson</h4>
<pre>&lt;T&gt;&nbsp;T&nbsp;fromJson(java.io.Reader&nbsp;reader,
java.lang.Class&lt;T&gt;&nbsp;type)
throws <a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></pre>
<div class="block">Reads in a JSON data from the specified Reader and return the
resulting content tree.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - Type of the content tree's root object.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>reader</code> - The character stream is read as a JSON data.</dd>
<dd><code>type</code> - Type of the content tree's root object.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the newly created root object of the java content tree</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></code> - If any unexpected error(s) occur(s) during deserialization.</dd>
<dd><code>java.lang.NullPointerException</code> - If any of the parameters is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="fromJson-java.io.Reader-java.lang.reflect.Type-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromJson</h4>
<pre>&lt;T&gt;&nbsp;T&nbsp;fromJson(java.io.Reader&nbsp;reader,
java.lang.reflect.Type&nbsp;runtimeType)
throws <a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></pre>
<div class="block">Reads in a JSON data from the specified Reader and return the
resulting content tree.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - Type of the content tree's root object.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>reader</code> - The character stream is read as a JSON data.</dd>
<dd><code>runtimeType</code> - Runtime type of the content tree's root object.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the newly created root object of the java content tree</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></code> - If any unexpected error(s) occur(s) during deserialization.</dd>
<dd><code>java.lang.NullPointerException</code> - If any of the parameters is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="fromJson-java.io.InputStream-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromJson</h4>
<pre>&lt;T&gt;&nbsp;T&nbsp;fromJson(java.io.InputStream&nbsp;stream,
java.lang.Class&lt;T&gt;&nbsp;type)
throws <a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></pre>
<div class="block">Reads in a JSON data from the specified InputStream and return the
resulting content tree.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - Type of the content tree's root object.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>stream</code> - The stream is read as a JSON data. Upon a
successful completion, the stream will be closed by this method.</dd>
<dd><code>type</code> - Type of the content tree's root object.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the newly created root object of the java content tree</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></code> - If any unexpected error(s) occur(s) during deserialization.</dd>
<dd><code>java.lang.NullPointerException</code> - If any of the parameters is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="fromJson-java.io.InputStream-java.lang.reflect.Type-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromJson</h4>
<pre>&lt;T&gt;&nbsp;T&nbsp;fromJson(java.io.InputStream&nbsp;stream,
java.lang.reflect.Type&nbsp;runtimeType)
throws <a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></pre>
<div class="block">Reads in a JSON data from the specified InputStream and return the
resulting content tree.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - Type of the content tree's root object.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>stream</code> - The stream is read as a JSON data. Upon a
successful completion, the stream will be closed by this method.</dd>
<dd><code>runtimeType</code> - Runtime type of the content tree's root object.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the newly created root object of the java content tree</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></code> - If any unexpected error(s) occur(s) during deserialization.</dd>
<dd><code>java.lang.NullPointerException</code> - If any of the parameters is <code>null</code>.</dd>
</dl>
</li>
</ul>
<a name="toJson-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toJson</h4>
<pre>java.lang.String&nbsp;toJson(java.lang.Object&nbsp;object)
throws <a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></pre>
<div class="block">Writes the Java object tree with root object <code>object</code> to a String
instance as JSON.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>object</code> - The root object of the object content tree to be serialized. Must not be null.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>String instance with serialized JSON data.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></code> - If any unexpected problem occurs during the
serialization, such as I/O error.</dd>
<dd><code>java.lang.NullPointerException</code> - If any of the parameters is <code>null</code>.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>JSON Binding 1.0</dd>
</dl>
</li>
</ul>
<a name="toJson-java.lang.Object-java.lang.reflect.Type-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toJson</h4>
<pre>java.lang.String&nbsp;toJson(java.lang.Object&nbsp;object,
java.lang.reflect.Type&nbsp;runtimeType)
throws <a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></pre>
<div class="block">Writes the Java object tree with root object <code>object</code> to a String
instance as JSON.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>object</code> - The root object of the object content tree to be serialized. Must not be null.</dd>
<dd><code>runtimeType</code> - Runtime type of the content tree's root object.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>String instance with serialized JSON data.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></code> - If any unexpected problem occurs during the
serialization, such as I/O error.</dd>
<dd><code>java.lang.NullPointerException</code> - If any of the parameters is <code>null</code>.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>JSON Binding 1.0</dd>
</dl>
</li>
</ul>
<a name="toJson-java.lang.Object-java.io.Writer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toJson</h4>
<pre>void&nbsp;toJson(java.lang.Object&nbsp;object,
java.io.Writer&nbsp;writer)
throws <a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></pre>
<div class="block">Writes the object content tree into a Writer character stream.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>object</code> - The object content tree to be serialized.</dd>
<dd><code>writer</code> - The JSON will be sent as a character stream to the given
<code>Writer</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></code> - If any unexpected problem occurs during the
serialization.</dd>
<dd><code>java.lang.NullPointerException</code> - If any of the parameters is <code>null</code>.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>JSON Binding 1.0</dd>
</dl>
</li>
</ul>
<a name="toJson-java.lang.Object-java.lang.reflect.Type-java.io.Writer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toJson</h4>
<pre>void&nbsp;toJson(java.lang.Object&nbsp;object,
java.lang.reflect.Type&nbsp;runtimeType,
java.io.Writer&nbsp;writer)
throws <a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></pre>
<div class="block">Writes the object content tree into a Writer character stream.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>object</code> - The object content tree to be serialized.</dd>
<dd><code>runtimeType</code> - Runtime type of the content tree's root object.</dd>
<dd><code>writer</code> - The JSON will be sent as a character stream to the given
<code>Writer</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></code> - If any unexpected problem occurs during the
serialization.</dd>
<dd><code>java.lang.NullPointerException</code> - If any of the parameters is <code>null</code>.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>JSON Binding 1.0</dd>
</dl>
</li>
</ul>
<a name="toJson-java.lang.Object-java.io.OutputStream-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toJson</h4>
<pre>void&nbsp;toJson(java.lang.Object&nbsp;object,
java.io.OutputStream&nbsp;stream)
throws <a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></pre>
<div class="block">Writes the object content tree into output stream.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>object</code> - The object content tree to be serialized.</dd>
<dd><code>stream</code> - The JSON will be sent as a byte stream to the given
<code>OutputStream</code>. Upon a successful completion, the stream will be closed
by this method.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></code> - If any unexpected problem occurs during the
serialization.</dd>
<dd><code>java.lang.NullPointerException</code> - If any of the parameters is <code>null</code>.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>JSON Binding 1.0</dd>
</dl>
</li>
</ul>
<a name="toJson-java.lang.Object-java.lang.reflect.Type-java.io.OutputStream-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toJson</h4>
<pre>void&nbsp;toJson(java.lang.Object&nbsp;object,
java.lang.reflect.Type&nbsp;runtimeType,
java.io.OutputStream&nbsp;stream)
throws <a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></pre>
<div class="block">Writes the object content tree into output stream.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>object</code> - The object content tree to be serialized.</dd>
<dd><code>runtimeType</code> - Runtime type of the content tree's root object.</dd>
<dd><code>stream</code> - The JSON will be sent as a byte stream to the given
<code>OutputStream</code>. Upon a successful completion, the stream will be closed
by this method.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/bind/JsonbException.html" title="class in javax.json.bind">JsonbException</a></code> - If any unexpected problem occurs during the
serialization.</dd>
<dd><code>java.lang.NullPointerException</code> - If any of the parameters is <code>null</code>.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>JSON Binding 1.0</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>Prev&nbsp;Class</li>
<li><a href="../../../javax/json/bind/JsonbBuilder.html" title="interface in javax.json.bind"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/json/bind/Jsonb.html" target="_top">Frames</a></li>
<li><a href="Jsonb.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>