blob: 2698078911063d0324486a01f9f8d20c5ddc37a4 [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>
<!-- Generated by javadoc (9.0.1) on Fri Dec 28 04:30:34 EST 2018 -->
<title>JsonGenerator (JSR 374 (JSON Processing) API 1.1.5 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="date" content="2018-12-28">
<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-1.10.2.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="JsonGenerator (JSR 374 (JSON Processing) API 1.1.5 API)";
}
}
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,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6,"i17":6,"i18":6,"i19":6,"i20":6,"i21":6,"i22":6,"i23":6,"i24":6,"i25":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 = "../../../";loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="fixedNav">
<!-- ========= 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="../../../java.json-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/JsonGenerator.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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../javax/json/stream/JsonGeneratorFactory.html" title="interface in javax.json.stream"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/json/stream/JsonGenerator.html" target="_top">Frames</a></li>
<li><a href="JsonGenerator.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>
<ul class="navListSearch">
<li><span>SEARCH:&nbsp;</span>
<input type="text" id="search" value=" " disabled="disabled">
<input type="reset" id="reset" value=" " 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><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&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 ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle"><span class="moduleLabelInType">Module</span>&nbsp;<a href="../../../java.json-summary.html">java.json</a></div>
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="../../../javax/json/stream/package-summary.html">javax.json.stream</a></div>
<h2 title="Interface JsonGenerator" class="title">Interface JsonGenerator</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></code>, <code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></code>, <code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Flushable.html?is-external=true" title="class or interface in java.io">Flushable</a></code></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">JsonGenerator</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Flushable.html?is-external=true" title="class or interface in java.io">Flushable</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></pre>
<div class="block">Writes JSON data to an output source in a streaming way. The class
<a href="../../../javax/json/Json.html" title="class in javax.json"><code>Json</code></a> contains methods to create generators for character
or output streams (<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io"><code>Writer</code></a> and <a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io"><code>OutputStream</code></a>).
<p>
The following example shows how to create a JSON generator:
<pre>
<code>
JsonGenerator generator = Json.createGenerator(...);
</code>
</pre>
<p>
The class <a href="../../../javax/json/stream/JsonGeneratorFactory.html" title="interface in javax.json.stream"><code>JsonGeneratorFactory</code></a> also contains methods to create
<code>JsonGenerator</code> instances. <a href="../../../javax/json/stream/JsonGeneratorFactory.html" title="interface in javax.json.stream"><code>JsonGeneratorFactory</code></a> should be used
when creating multiple generator instances, as in the following example:
<pre>
<code>
JsonGeneratorFactory factory = Json.createGeneratorFactory();
JsonGenerator generator1 = factory.createGenerator(...);
JsonGenerator generator2 = factory.createGenerator(...);
</code>
</pre>
<p>
JSON objects can be created using <code>JsonGenerator</code> by calling the
<a href="../../../javax/json/stream/JsonGenerator.html#writeStartObject--"><code>writeStartObject()</code></a> method and then adding name/value pairs with the
<code>write</code> method.
<p>
The following example shows how to generate an empty JSON object:
<pre>
<code>
JsonGenerator generator = ...;
generator.writeStartObject().writeEnd().close();
</code>
</pre>
JSON arrays can be created using <code>JsonGenerator</code> by calling the
<a href="../../../javax/json/stream/JsonGenerator.html#writeStartArray--"><code>writeStartArray()</code></a> method and then adding values with the
<code>write</code> method.
<p>
The following example shows how to generate an empty JSON array:
<pre>
<code>
JsonGenerator generator = ...;
generator.writeStartArray().writeEnd().close();
</code>
</pre>
<p>
Other JSON values (that are not JSON objects or arrays) can be created
by calling the appropiate <code>write</code> methods.
<p>
The following example shows how to generate a JSON string:
<pre><code>
JsonGenerator generator = ...;
generator.write("message").close();
</code></pre>
<code>JsonGenerator</code> methods can be chained as in the following example:
<pre>
<code>
generator
.writeStartObject()
.write("firstName", "John")
.write("lastName", "Smith")
.write("age", 25)
.writeStartObject("address")
.write("streetAddress", "21 2nd Street")
.write("city", "New York")
.write("state", "NY")
.write("postalCode", "10021")
.writeEnd()
.writeStartArray("phoneNumber")
.writeStartObject()
.write("type", "home")
.write("number", "212 555-1234")
.writeEnd()
.writeStartObject()
.write("type", "fax")
.write("number", "646 555-4567")
.writeEnd()
.writeEnd()
.writeEnd();
generator.close();
</code>
</pre>
The example code above generates the following JSON (or equivalent):
<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>
The generated JSON text must strictly conform to the grammar defined in
<a href="http://www.ietf.org/rfc/rfc7159.txt">RFC 7159</a>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../javax/json/Json.html" title="class in javax.json"><code>Json</code></a>,
<a href="../../../javax/json/stream/JsonGeneratorFactory.html" title="interface in javax.json.stream"><code>JsonGeneratorFactory</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#PRETTY_PRINTING">PRETTY_PRINTING</a></span></code></th>
<td class="colLast">
<div class="block">Configuration property to generate JSON prettily.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" 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="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#close--">close</a></span>&#8203;()</code></th>
<td class="colLast">
<div class="block">Closes this generator and frees any resources associated with it.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#flush--">flush</a></span>&#8203;()</code></th>
<td class="colLast">
<div class="block">Flushes the underlying output source.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-boolean-">write</a></span>&#8203;(boolean&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes a JSON true or false value within the current array, field or root context.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-double-">write</a></span>&#8203;(double&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes the specified value as a JSON number value within the current
array, field or root context.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-int-">write</a></span>&#8203;(int&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes the specified value as a JSON number value within
the current array, field or root context.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-long-">write</a></span>&#8203;(long&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes the specified value as a JSON number value within
the current array, field or root context.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-java.lang.String-">write</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes the specified value as a JSON string value within
the current array, field or root context.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-java.lang.String-boolean-">write</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
boolean&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes a JSON name/boolean value pair in the current object context.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-java.lang.String-double-">write</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
double&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes a JSON name/number value pair in the current object context.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-java.lang.String-int-">write</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
int&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes a JSON name/number value pair in the current object context.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-java.lang.String-long-">write</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
long&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes a JSON name/number value pair in the current object context.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-java.lang.String-java.lang.String-">write</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes a JSON name/string value pair in the current object context.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-java.lang.String-java.math.BigDecimal-">write</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math">BigDecimal</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes a JSON name/number value pair in the current object context.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-java.lang.String-java.math.BigInteger-">write</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="https://docs.oracle.com/javase/8/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes a JSON name/number value pair in the current object context.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-java.lang.String-javax.json.JsonValue-">write</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="../../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes a JSON name/value pair in the current object context.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-java.math.BigDecimal-">write</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math">BigDecimal</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes the specified value as a JSON number value within
the current array, field or root context.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-java.math.BigInteger-">write</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes the specified value as a JSON number value within
the current array, field or root context.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#write-javax.json.JsonValue-">write</a></span>&#8203;(<a href="../../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Writes the specified value as a JSON value within
the current array, field or root context.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#writeEnd--">writeEnd</a></span>&#8203;()</code></th>
<td class="colLast">
<div class="block">Writes the end of the current context.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#writeKey-java.lang.String-">writeKey</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code></th>
<td class="colLast">
<div class="block">Writes the JSON name with a colon.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#writeNull--">writeNull</a></span>&#8203;()</code></th>
<td class="colLast">
<div class="block">Writes a JSON null value within the current array, field or root context.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#writeNull-java.lang.String-">writeNull</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code></th>
<td class="colLast">
<div class="block">Writes a JSON name/null value pair in an current object context.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#writeStartArray--">writeStartArray</a></span>&#8203;()</code></th>
<td class="colLast">
<div class="block">Writes the JSON start array character.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#writeStartArray-java.lang.String-">writeStartArray</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code></th>
<td class="colLast">
<div class="block">Writes the JSON name/start array character pair with in the current
object context.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#writeStartObject--">writeStartObject</a></span>&#8203;()</code></th>
<td class="colLast">
<div class="block">Writes the JSON start object character.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonGenerator.html#writeStartObject-java.lang.String-">writeStartObject</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code></th>
<td class="colLast">
<div class="block">Writes the JSON name/start object character pair in the current
object context.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="PRETTY_PRINTING">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>PRETTY_PRINTING</h4>
<pre>static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> PRETTY_PRINTING</pre>
<div class="block">Configuration property to generate JSON prettily. All providers
must support this property. The value of the property could be
be anything.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../constant-values.html#javax.json.stream.JsonGenerator.PRETTY_PRINTING">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="writeStartObject--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeStartObject</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;writeStartObject&#8203;()</pre>
<div class="block">Writes the JSON start object character. It starts a new child object
context within which JSON name/value pairs can be written to the object.
This method is valid only in an array context, field context or in no context (when a
context is not yet started). This method can only be called once in
no context.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is called within an
object context or if it is called more than once in no context.</dd>
</dl>
</li>
</ul>
<a name="writeStartObject-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeStartObject</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;writeStartObject&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
<div class="block">Writes the JSON name/start object character pair in the current
object context. It starts a new child object context within which JSON
name/value pairs can be written to the object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - a name within the JSON name/object pair to be written</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
object context</dd>
</dl>
</li>
</ul>
<a name="writeKey-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeKey</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;writeKey&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
<div class="block">Writes the JSON name with a colon. It starts a field context, in which valid
options are writing a value, starting an object or an array.
Writing value closes field context, if object or array is started after field name,
field context will be closed after object/array close.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - name of json field</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
object context</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
</dl>
</li>
</ul>
<a name="writeStartArray--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeStartArray</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;writeStartArray&#8203;()</pre>
<div class="block">Writes the JSON start array character. It starts a new child array
context within which JSON values can be written to the array. This
method is valid only in an array context, field context or in no context (when a
context is not yet started). This method can only be called once in
no context.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is called within an
object context or if called more than once in no context</dd>
</dl>
</li>
</ul>
<a name="writeStartArray-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeStartArray</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;writeStartArray&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
<div class="block">Writes the JSON name/start array character pair with in the current
object context. It starts a new child array context within which JSON
values can be written to the array.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - a name within the JSON name/array pair to be written</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within
an object context</dd>
</dl>
</li>
</ul>
<a name="write-java.lang.String-javax.json.JsonValue-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="../../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&nbsp;value)</pre>
<div class="block">Writes a JSON name/value pair in the current object context.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - a name in the JSON name/value pair to be written in
current JSON object</dd>
<dd><code>value</code> - a value in the JSON name/value pair to be written in
current JSON object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
object context</dd>
</dl>
</li>
</ul>
<a name="write-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</pre>
<div class="block">Writes a JSON name/string value pair in the current object context.
The specified value is written as JSON string value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - a name in the JSON name/string pair to be written in
current JSON object</dd>
<dd><code>value</code> - a value in the JSON name/string pair to be written in
current JSON object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
object context</dd>
</dl>
</li>
</ul>
<a name="write-java.lang.String-java.math.BigInteger-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="https://docs.oracle.com/javase/8/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a>&nbsp;value)</pre>
<div class="block">Writes a JSON name/number value pair in the current object context.
The specified value is written as a JSON number value. The string
<code>new BigDecimal(value).toString()</code>
is used as the text value for writing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - a name in the JSON name/number pair to be written in
current JSON object</dd>
<dd><code>value</code> - a value in the JSON name/number pair to be written in
current JSON object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
object context.</dd>
</dl>
</li>
</ul>
<a name="write-java.lang.String-java.math.BigDecimal-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math">BigDecimal</a>&nbsp;value)</pre>
<div class="block">Writes a JSON name/number value pair in the current object context.
The specified value is written as a JSON number value. The specified
value's <code>toString()</code> is used as the text value for writing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - a name in the JSON name/number pair to be written in
current JSON object</dd>
<dd><code>value</code> - a value in the JSON name/number pair to be written in
current JSON object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
object context.</dd>
</dl>
</li>
</ul>
<a name="write-java.lang.String-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
int&nbsp;value)</pre>
<div class="block">Writes a JSON name/number value pair in the current object context.
The specified value is written as a JSON number value. The string
<code>new BigDecimal(value).toString()</code> is used as the text value
for writing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - a name in the JSON name/number pair to be written in
current JSON object</dd>
<dd><code>value</code> - a value in the JSON name/number pair to be written in
current JSON object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
object context.</dd>
</dl>
</li>
</ul>
<a name="write-java.lang.String-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
long&nbsp;value)</pre>
<div class="block">Writes a JSON name/number value pair in the current object context.
The specified value is written as a JSON number value. The string
<code>new BigDecimal(value).toString()</code> is used as the text
value for writing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - a name in the JSON name/number pair to be written in
current JSON object</dd>
<dd><code>value</code> - a value in the JSON name/number pair to be written in
current JSON object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
object context.</dd>
</dl>
</li>
</ul>
<a name="write-java.lang.String-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
double&nbsp;value)</pre>
<div class="block">Writes a JSON name/number value pair in the current object context.
The specified value is written as a JSON number value. The string
<code>BigDecimal.valueOf(double).toString()</code>
is used as the text value for writing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - a name in the JSON name/number pair to be written in
current JSON object</dd>
<dd><code>value</code> - a value in the JSON name/number pair to be written in
current JSON object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</a></code> - if the value is Not-a-Number (NaN) or infinity.</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
object context</dd>
</dl>
</li>
</ul>
<a name="write-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
boolean&nbsp;value)</pre>
<div class="block">Writes a JSON name/boolean value pair in the current object context.
If value is true, it writes the JSON <code>true</code> value, otherwise
it writes the JSON <code>false</code> value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - a name in the JSON name/boolean pair to be written in
current JSON object</dd>
<dd><code>value</code> - a value in the JSON name/boolean pair to be written in
current JSON object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
object context.</dd>
</dl>
</li>
</ul>
<a name="writeNull-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeNull</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;writeNull&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
<div class="block">Writes a JSON name/null value pair in an current object context.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - a name in the JSON name/null pair to be written in
current JSON object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
object context</dd>
</dl>
</li>
</ul>
<a name="writeEnd--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeEnd</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;writeEnd&#8203;()</pre>
<div class="block">Writes the end of the current context. If the current context is
an array context, this method writes the end-of-array character (']').
If the current context is an object context, this method writes the
end-of-object character ('}'). After writing the end of the current
context, the parent context becomes the new current context.
If parent context is field context, it is closed.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is called in no context.</dd>
</dl>
</li>
</ul>
<a name="write-javax.json.JsonValue-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(<a href="../../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&nbsp;value)</pre>
<div class="block">Writes the specified value as a JSON value within
the current array, field or root context.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - a value to be written in current JSON array</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
array or root context.</dd>
</dl>
</li>
</ul>
<a name="write-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</pre>
<div class="block">Writes the specified value as a JSON string value within
the current array, field or root context.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - a value to be written in current JSON array</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
array or root context.</dd>
</dl>
</li>
</ul>
<a name="write-java.math.BigDecimal-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math">BigDecimal</a>&nbsp;value)</pre>
<div class="block">Writes the specified value as a JSON number value within
the current array, field or root context. The specified value's <code>toString()</code>
is used as the the text value for writing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - a value to be written in current JSON array</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
array or root context.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../javax/json/JsonNumber.html" title="interface in javax.json"><code>JsonNumber</code></a></dd>
</dl>
</li>
</ul>
<a name="write-java.math.BigInteger-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a>&nbsp;value)</pre>
<div class="block">Writes the specified value as a JSON number value within
the current array, field or root context. The string <code>new BigDecimal(value).toString()</code>
is used as the text value for writing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - a value to be written in current JSON array</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
array or root context.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../javax/json/JsonNumber.html" title="interface in javax.json"><code>JsonNumber</code></a></dd>
</dl>
</li>
</ul>
<a name="write-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(int&nbsp;value)</pre>
<div class="block">Writes the specified value as a JSON number value within
the current array, field or root context. The string <code>new BigDecimal(value).toString()</code>
is used as the text value for writing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - a value to be written in current JSON array</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
array or root context.</dd>
</dl>
</li>
</ul>
<a name="write-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(long&nbsp;value)</pre>
<div class="block">Writes the specified value as a JSON number value within
the current array, field or root context. The string <code>new BigDecimal(value).toString()</code>
is used as the text value for writing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - a value to be written in current JSON array</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
array or root context.</dd>
</dl>
</li>
</ul>
<a name="write-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(double&nbsp;value)</pre>
<div class="block">Writes the specified value as a JSON number value within the current
array, field or root context. The string <code>BigDecimal.valueOf(value).toString()</code>
is used as the text value for writing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - a value to be written in current JSON array</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
array or root context.</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NumberFormatException.html?is-external=true" title="class or interface in java.lang">NumberFormatException</a></code> - if the value is Not-a-Number (NaN) or infinity.</dd>
</dl>
</li>
</ul>
<a name="write-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;write&#8203;(boolean&nbsp;value)</pre>
<div class="block">Writes a JSON true or false value within the current array, field or root context.
If value is true, this method writes the JSON <code>true</code> value,
otherwise it writes the JSON <code>false</code> value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - a <code>boolean</code> value</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
array or root context.</dd>
</dl>
</li>
</ul>
<a name="writeNull--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeNull</h4>
<pre><a href="../../../javax/json/stream/JsonGenerator.html" title="interface in javax.json.stream">JsonGenerator</a>&nbsp;writeNull&#8203;()</pre>
<div class="block">Writes a JSON null value within the current array, field or root context.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this generator</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if this method is not called within an
array or root context.</dd>
</dl>
</li>
</ul>
<a name="close--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre>void&nbsp;close&#8203;()</pre>
<div class="block">Closes this generator and frees any resources associated with it.
This method closes the underlying output source.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true#close--" title="class or interface in java.lang">close</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true#close--" title="class or interface in java.io">close</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</dd>
<dd><code><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream">JsonGenerationException</a></code> - if an incomplete JSON is generated</dd>
</dl>
</li>
</ul>
<a name="flush--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>flush</h4>
<pre>void&nbsp;flush&#8203;()</pre>
<div class="block">Flushes the underlying output source. If the generator has saved
any characters in a buffer, writes them immediately to the underlying
output source before flushing it.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Flushable.html?is-external=true#flush--" title="class or interface in java.io">flush</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Flushable.html?is-external=true" title="class or interface in java.io">Flushable</a></code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../javax/json/JsonException.html" title="class in javax.json">JsonException</a></code> - if an i/o error occurs (IOException
would be cause of JsonException)</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="../../../java.json-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/JsonGenerator.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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javax/json/stream/JsonGenerationException.html" title="class in javax.json.stream"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../javax/json/stream/JsonGeneratorFactory.html" title="interface in javax.json.stream"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/json/stream/JsonGenerator.html" target="_top">Frames</a></li>
<li><a href="JsonGenerator.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>
<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><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&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 ======= -->
<p class="legalCopy"><small>Copyright &#169; 2012-2018, <a href="http://www.oracle.com">Oracle</a> and/or its affiliates. All Rights Reserved. Use is subject to <a href="../../../doc-files/speclicense.html" target="_top">license terms</a>. <br>Comments to : jsonp-dev@eclipse.org</small></p>
</body>
</html>