<!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 (1.8.0_144) on Wed Sep 06 08:23:32 PDT 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JsonParser (Java(TM) EE 8 Specification APIs)</title>
<meta name="date" content="2017-09-06">
<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="JsonParser (Java(TM) EE 8 Specification APIs)";
        }
    }
    catch(err) {
    }
//-->
var methods = {"i0":6,"i1":18,"i2":18,"i3":6,"i4":6,"i5":6,"i6":6,"i7":18,"i8":18,"i9":6,"i10":18,"i11":18,"i12":6,"i13":6,"i14":6,"i15":18,"i16":18};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default 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="class-use/JsonParser.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/JsonLocation.html" title="interface in javax.json.stream"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../javax/json/stream/JsonParser.Event.html" title="enum 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/JsonParser.html" target="_top">Frames</a></li>
<li><a href="JsonParser.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><a href="#nested.class.summary">Nested</a>&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.stream</div>
<h2 title="Interface JsonParser" class="title">Interface JsonParser</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">JsonParser</span>
extends <a href="http://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">Provides forward, read-only access to JSON data in a streaming way. This
 is the most efficient way for reading JSON data.
 This is the only way to parse and process JSON data that are too big to be loaded in memory.
 <p>The class
 <a href="../../../javax/json/Json.html" title="class in javax.json"><code>Json</code></a> contains methods to create parsers from input
 sources (<a href="http://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><code>InputStream</code></a> and <a href="http://docs.oracle.com/javase/8/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io"><code>Reader</code></a>).

 <p>
 The following example demonstrates how to create a parser from a string
 that contains an empty JSON array:
 <pre>
 <code>
 JsonParser parser = Json.createParser(new StringReader("[]"));
 </code>
 </pre>

 <p>
 The class <a href="../../../javax/json/stream/JsonParserFactory.html" title="interface in javax.json.stream"><code>JsonParserFactory</code></a> also contains methods to create
 <code>JsonParser</code> instances. <a href="../../../javax/json/stream/JsonParserFactory.html" title="interface in javax.json.stream"><code>JsonParserFactory</code></a> is preferred
 when creating multiple parser instances. A sample usage is shown
 in the following example:
 <pre>
 <code>
 JsonParserFactory factory = Json.createParserFactory();
 JsonParser parser1 = factory.createParser(...);
 JsonParser parser2 = factory.createParser(...);
 </code>
 </pre>

 <p>
 <code>JsonParser</code> parses JSON using the pull parsing programming model.
 In this model the client code controls the thread and calls the method
 <code>next()</code> to advance the parser to the next state after
 processing each element. The parser can generate the following events:
 <code>START_OBJECT</code>, <code>END_OBJECT</code>, <code>START_ARRAY</code>,
 <code>END_ARRAY</code>, <code>KEY_NAME</code>, <code>VALUE_STRING</code>,
 <code>VALUE_NUMBER</code>, <code>VALUE_TRUE</code>, <code>VALUE_FALSE</code>,
 and <code>VALUE_NULL</code>.

 <p>
 <b>For example</b>, for an empty JSON object ({ }), the parser generates the event
 <code>START_OBJECT</code> with the first call to the method <code>next()</code> and the
 event <code>END_OBJECT</code> with the second call to the method <code>next()</code>.
 The following code demonstrates how to access these events:

 <pre>
 <code>
 Event event = parser.next(); // START_OBJECT
 event = parser.next();       // END_OBJECT
 </code>
 </pre>

 <p>
 <b>For example</b>, for the following JSON:
 <pre>
 {
   "firstName": "John", "lastName": "Smith", "age": 25,
   "phoneNumber": [
       { "type": "home", "number": "212 555-1234" },
       { "type": "fax", "number": "646 555-4567" }
    ]
 }
 </pre>

 <p>calls to the method <code>next()</code> result in parse events at the specified
 locations below (marked in bold):

 <pre>
 {<B>START_OBJECT</B>
   "firstName"<B>KEY_NAME</B>: "John"<B>VALUE_STRING</B>, "lastName"<B>KEY_NAME</B>: "Smith"<B>VALUE_STRING</B>, "age"<B>KEY_NAME</B>: 25<B>VALUE_NUMBER</B>,
   "phoneNumber"<B>KEY_NAME</B> : [<B>START_ARRAY</B>
       {<B>START_OBJECT</B> "type"<B>KEY_NAME</B>: "home"<B>VALUE_STRING</B>, "number"<B>KEY_NAME</B>: "212 555-1234"<B>VALUE_STRING</B> }<B>END_OBJECT</B>,
       {<B>START_OBJECT</B> "type"<B>KEY_NAME</B>: "fax"<B>VALUE_STRING</B>, "number"<B>KEY_NAME</B>: "646 555-4567"<B>VALUE_STRING</B> }<B>END_OBJECT</B>
    ]<B>END_ARRAY</B>
 }<B>END_OBJECT</B>
 </pre>

 The methods <a href="../../../javax/json/stream/JsonParser.html#next--"><code>next()</code></a> and <a href="../../../javax/json/stream/JsonParser.html#hasNext--"><code>hasNext()</code></a> enable iteration over
 parser events to process JSON data. <code>JsonParser</code> provides get methods
 to obtain the value at the current state of the parser. For example, the
 following code shows how to obtain the value "John" from the JSON above:

 <pre>
 <code>
 Event event = parser.next(); // START_OBJECT
 event = parser.next();       // KEY_NAME
 event = parser.next();       // VALUE_STRING
 parser.getString();          // "John"
 </code>
 </pre>

 Starting in version 1.1, it is possible to build a partial JSON object
 model from the stream, at the current parser position.
 The methods <a href="../../../javax/json/stream/JsonParser.html#getArray--"><code>getArray()</code></a> and <a href="../../../javax/json/stream/JsonParser.html#getObject--"><code>getObject()</code></a> can be used to read in
 a <code>JsonArray</code> or <code>JsonObject</code>.  For example, the following code
 shows how to obtain the phoneNumber in a JsonArray, from the JSON above:

 <pre><code>
 while (parser.hasNext() {
     Event event = parser.next();
     if (event == JsonParser.Event.KEY_NAME ) {
         String key = getString();
         event = parser.next();
         if (key.equals("phoneNumber") {
             JsonArray phones = parser.getArray();
         }
     }
 }
 </code></pre>

 The methods <a href="../../../javax/json/stream/JsonParser.html#getArrayStream--"><code>getArrayStream()</code></a> and <a href="../../../javax/json/stream/JsonParser.html#getObjectStream--"><code>getObjectStream()</code></a> can be used
 to get a stream of the elements of a <code>JsonArray</code> or <code>JsonObject</code>.
 For example, the following code shows another way to obtain John's phoneNumber
 in a <code>JsonArray</code> :

 <pre><code>
 Event event = parser.next(); // START_OBJECT
 JsonArray phones = (JsonArray)
     parser.getObjectStream().filter(e-&gt;e.getKey().equals("phoneNumber"))
                             .map(e-&gt;e.getValue())
                             .findFirst()
                             .get();
 </code></pre>

 The methods <a href="../../../javax/json/stream/JsonParser.html#skipArray--"><code>skipArray()</code></a> and <a href="../../../javax/json/stream/JsonParser.html#skipObject--"><code>skipObject()</code></a> can be used to
 skip tokens and position the parser to <code>END_ARRAY</code> or
 <code>END_OBJECT</code>.
 <p>
 <code>JsonParser</code> can be used to parse sequence of JSON values that are not
 enclosed in a JSON array, e.g. { } { }. The following code demonstrates how
 to parse such sequence.
 <pre><code>
 JsonParser parser = Json.createParser(...);
 while (parser.hasNext) {
     parser.next(); // advance parser state
     JsonValue value = parser.getValue();
 }
 </code></pre></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/JsonParserFactory.html" title="interface in javax.json.stream"><code>JsonParserFactory</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!--   -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Interface and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.Event.html" title="enum in javax.json.stream">JsonParser.Event</a></span></code>
<div class="block">An event from <code>JsonParser</code>.</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" 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><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default 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>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#close--">close</a></span>()</code>
<div class="block">Closes this parser and frees any resources associated with the
 parser.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>default <a href="../../../javax/json/JsonArray.html" title="interface in javax.json">JsonArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#getArray--">getArray</a></span>()</code>
<div class="block">Returns a <code>JsonArray</code> and advance the parser to the
 the corresponding <code>END_ARRAY</code>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>default <a href="http://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html?is-external=true" title="class or interface in java.util.stream">Stream</a>&lt;<a href="../../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#getArrayStream--">getArrayStream</a></span>()</code>
<div class="block">Returns a stream of the <code>JsonArray</code> elements.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math">BigDecimal</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#getBigDecimal--">getBigDecimal</a></span>()</code>
<div class="block">Returns a JSON number as a <code>BigDecimal</code>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#getInt--">getInt</a></span>()</code>
<div class="block">Returns a JSON number as an integer.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonLocation.html" title="interface in javax.json.stream">JsonLocation</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#getLocation--">getLocation</a></span>()</code>
<div class="block">Return the location that corresponds to the parser's current state in
 the JSON input source.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#getLong--">getLong</a></span>()</code>
<div class="block">Returns a JSON number as a long.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>default <a href="../../../javax/json/JsonObject.html" title="interface in javax.json">JsonObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#getObject--">getObject</a></span>()</code>
<div class="block">Returns a <code>JsonObject</code> and advances the parser to the
 corresponding <code>END_OBJECT</code>.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>default <a href="http://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html?is-external=true" title="class or interface in java.util.stream">Stream</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">Map.Entry</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#getObjectStream--">getObjectStream</a></span>()</code>
<div class="block">Returns a stream of the <code>JsonObject</code>'s
 name/value pairs.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="http://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>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#getString--">getString</a></span>()</code>
<div class="block">Returns a <code>String</code> for the name in a name/value pair,
 for a string value or a number value.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>default <a href="../../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#getValue--">getValue</a></span>()</code>
<div class="block">Returns a <code>JsonValue</code> at the current parser position.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>default <a href="http://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html?is-external=true" title="class or interface in java.util.stream">Stream</a>&lt;<a href="../../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#getValueStream--">getValueStream</a></span>()</code>
<div class="block">Returns a stream of <code>JsonValue</code> from a sequence of
 JSON values.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#hasNext--">hasNext</a></span>()</code>
<div class="block">Returns <code>true</code> if there are more parsing states.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#isIntegralNumber--">isIntegralNumber</a></span>()</code>
<div class="block">Returns true if the JSON number at the current parser state is a
 integral number.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code><a href="../../../javax/json/stream/JsonParser.Event.html" title="enum in javax.json.stream">JsonParser.Event</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#next--">next</a></span>()</code>
<div class="block">Returns the event for the next parsing state.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>default void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#skipArray--">skipArray</a></span>()</code>
<div class="block">Advance the parser to <code>END_ARRAY</code>.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>default void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/json/stream/JsonParser.html#skipObject--">skipObject</a></span>()</code>
<div class="block">Advance the parser to <code>END_OBJECT</code>.</div>
</td>
</tr>
</table>
</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="hasNext--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasNext</h4>
<pre>boolean&nbsp;hasNext()</pre>
<div class="block">Returns <code>true</code> if there are more parsing states. This method returns
 <code>false</code> if the parser reaches the end of the JSON text.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if there are more parsing states.</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/JsonParsingException.html" title="class in javax.json.stream">JsonParsingException</a></code> - if the parser encounters invalid JSON
 when advancing to next state.</dd>
</dl>
</li>
</ul>
<a name="next--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>next</h4>
<pre><a href="../../../javax/json/stream/JsonParser.Event.html" title="enum in javax.json.stream">JsonParser.Event</a>&nbsp;next()</pre>
<div class="block">Returns the event for the next parsing state.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the event for the next parsing state</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/JsonParsingException.html" title="class in javax.json.stream">JsonParsingException</a></code> - if the parser encounters invalid JSON
 when advancing to next state.</dd>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/util/NoSuchElementException.html?is-external=true" title="class or interface in java.util">NoSuchElementException</a></code> - if there are no more parsing
 states.</dd>
</dl>
</li>
</ul>
<a name="getString--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getString</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getString()</pre>
<div class="block">Returns a <code>String</code> for the name in a name/value pair,
 for a string value or a number value. This method should only be called
 when the parser state is <a href="../../../javax/json/stream/JsonParser.Event.html#KEY_NAME"><code>JsonParser.Event.KEY_NAME</code></a>, <a href="../../../javax/json/stream/JsonParser.Event.html#VALUE_STRING"><code>JsonParser.Event.VALUE_STRING</code></a>,
 or <a href="../../../javax/json/stream/JsonParser.Event.html#VALUE_NUMBER"><code>JsonParser.Event.VALUE_NUMBER</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a name when the parser state is <a href="../../../javax/json/stream/JsonParser.Event.html#KEY_NAME"><code>JsonParser.Event.KEY_NAME</code></a>
         a string value when the parser state is <a href="../../../javax/json/stream/JsonParser.Event.html#VALUE_STRING"><code>JsonParser.Event.VALUE_STRING</code></a>
         a number value when the parser state is <a href="../../../javax/json/stream/JsonParser.Event.html#VALUE_NUMBER"><code>JsonParser.Event.VALUE_NUMBER</code></a></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - when the parser state is not
      <code>KEY_NAME</code>, <code>VALUE_STRING</code>, or <code>VALUE_NUMBER</code></dd>
</dl>
</li>
</ul>
<a name="isIntegralNumber--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isIntegralNumber</h4>
<pre>boolean&nbsp;isIntegralNumber()</pre>
<div class="block">Returns true if the JSON number at the current parser state is a
 integral number. A <a href="http://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math"><code>BigDecimal</code></a> may be used to store the value
 internally and this method semantics are defined using its
 <code>scale()</code>. If the scale is zero, then it is considered integral
 type. This integral type information can be used to invoke an
 appropriate accessor method to obtain a numeric value as in the
 following example:

 <pre>
 <code>
 JsonParser parser = ...
 if (parser.isIntegralNumber()) {
     parser.getInt();     // or other methods to get integral value
 } else {
     parser.getBigDecimal();
 }
 </code>
 </pre></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if this number is a integral number, otherwise false</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - when the parser state is not
      <code>VALUE_NUMBER</code></dd>
</dl>
</li>
</ul>
<a name="getInt--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInt</h4>
<pre>int&nbsp;getInt()</pre>
<div class="block">Returns a JSON number as an integer. The returned value is equal
 to <code>new BigDecimal(getString()).intValue()</code>. Note that
 this conversion can lose information about the overall magnitude
 and precision of the number value as well as return a result with
 the opposite sign. This method should only be called when the parser
 state is <a href="../../../javax/json/stream/JsonParser.Event.html#VALUE_NUMBER"><code>JsonParser.Event.VALUE_NUMBER</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an integer for a JSON number</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - when the parser state is not
      <code>VALUE_NUMBER</code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="http://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html?is-external=true#intValue--" title="class or interface in java.math"><code>BigDecimal.intValue()</code></a></dd>
</dl>
</li>
</ul>
<a name="getLong--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLong</h4>
<pre>long&nbsp;getLong()</pre>
<div class="block">Returns a JSON number as a long. The returned value is equal
 to <code>new BigDecimal(getString()).longValue()</code>. Note that this
 conversion can lose information about the overall magnitude and
 precision of the number value as well as return a result with
 the opposite sign. This method is only called when the parser state is
 <a href="../../../javax/json/stream/JsonParser.Event.html#VALUE_NUMBER"><code>JsonParser.Event.VALUE_NUMBER</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a long for a JSON number</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - when the parser state is not
      <code>VALUE_NUMBER</code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="http://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html?is-external=true#longValue--" title="class or interface in java.math"><code>BigDecimal.longValue()</code></a></dd>
</dl>
</li>
</ul>
<a name="getBigDecimal--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBigDecimal</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math">BigDecimal</a>&nbsp;getBigDecimal()</pre>
<div class="block">Returns a JSON number as a <code>BigDecimal</code>. The <code>BigDecimal</code>
 is created using <code>new BigDecimal(getString())</code>. This
 method should only called when the parser state is
 <a href="../../../javax/json/stream/JsonParser.Event.html#VALUE_NUMBER"><code>JsonParser.Event.VALUE_NUMBER</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <code>BigDecimal</code> for a JSON number</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - when the parser state is not
      <code>VALUE_NUMBER</code></dd>
</dl>
</li>
</ul>
<a name="getLocation--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLocation</h4>
<pre><a href="../../../javax/json/stream/JsonLocation.html" title="interface in javax.json.stream">JsonLocation</a>&nbsp;getLocation()</pre>
<div class="block">Return the location that corresponds to the parser's current state in
 the JSON input source. The location information is only valid in the
 current parser state (or until the parser is advanced to a next state).</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a non-null location corresponding to the current parser state
 in JSON input source</dd>
</dl>
</li>
</ul>
<a name="getObject--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getObject</h4>
<pre>default&nbsp;<a href="../../../javax/json/JsonObject.html" title="interface in javax.json">JsonObject</a>&nbsp;getObject()</pre>
<div class="block">Returns a <code>JsonObject</code> and advances the parser to the
 corresponding <code>END_OBJECT</code>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <code>JsonObject</code> at the current parser position</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - when the parser state is not
     <code>START_OBJECT</code></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
</dl>
</li>
</ul>
<a name="getValue--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue</h4>
<pre>default&nbsp;<a href="../../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&nbsp;getValue()</pre>
<div class="block">Returns a <code>JsonValue</code> at the current parser position.
 If the parser state is <code>START_ARRAY</code>, the behavior is
 the same as <a href="../../../javax/json/stream/JsonParser.html#getArray--"><code>getArray()</code></a>. If the parser state is
 <code>START_OBJECT</code>, the behavior is the same as
 <a href="../../../javax/json/stream/JsonParser.html#getObject--"><code>getObject()</code></a>. For all other cases, if applicable, the JSON value is
 read and returned.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <code>JsonValue</code> at the current parser position.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - when the parser state is
     <code>END_OBJECT</code> or <code>END_ARRAY</code></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
</dl>
</li>
</ul>
<a name="getArray--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getArray</h4>
<pre>default&nbsp;<a href="../../../javax/json/JsonArray.html" title="interface in javax.json">JsonArray</a>&nbsp;getArray()</pre>
<div class="block">Returns a <code>JsonArray</code> and advance the parser to the
 the corresponding <code>END_ARRAY</code>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <code>JsonArray</code> at the current parser position</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - when the parser state is not
     <code>START_ARRAY</code></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
</dl>
</li>
</ul>
<a name="getArrayStream--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getArrayStream</h4>
<pre>default&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html?is-external=true" title="class or interface in java.util.stream">Stream</a>&lt;<a href="../../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;&nbsp;getArrayStream()</pre>
<div class="block">Returns a stream of the <code>JsonArray</code> elements.
 The parser state must be <code>START_ARRAY</code>.
 The elements are read lazily, on an as-needed basis, as
 required by the stream operations.
 If the stream operations do not consume
 all of the array elements, <code>skipArray</code> can be used to
 skip the unprocessed array elements.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a stream of elements of the <code>JsonArray</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - when the parser state is not
     <code>START_ARRAY</code></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
</dl>
</li>
</ul>
<a name="getObjectStream--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getObjectStream</h4>
<pre>default&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html?is-external=true" title="class or interface in java.util.stream">Stream</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">Map.Entry</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;&gt;&nbsp;getObjectStream()</pre>
<div class="block">Returns a stream of the <code>JsonObject</code>'s
 name/value pairs. The parser state must be <code>START_OBJECT</code>.
 The name/value pairs are read lazily, on an as-needed basis, as
 required by the stream operations.
 If the stream operations do not consume
 all of the object's name/value pairs, <code>skipObject</code> can be
 used to skip the unprocessed elements.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a stream of name/value pairs of the <code>JsonObject</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - when the parser state is not
     <code>START_OBJECT</code></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
</dl>
</li>
</ul>
<a name="getValueStream--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValueStream</h4>
<pre>default&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html?is-external=true" title="class or interface in java.util.stream">Stream</a>&lt;<a href="../../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;&nbsp;getValueStream()</pre>
<div class="block">Returns a stream of <code>JsonValue</code> from a sequence of
 JSON values. The values are read lazily, on an as-needed basis,
 as needed by the stream operations.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a Stream of <code>JsonValue</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if the parser is in an array or object.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
</dl>
</li>
</ul>
<a name="skipArray--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>skipArray</h4>
<pre>default&nbsp;void&nbsp;skipArray()</pre>
<div class="block">Advance the parser to <code>END_ARRAY</code>.
 If the parser is in array context, i.e. it has previously
 encountered a <code>START_ARRAY</code> without encountering the
 corresponding <code>END_ARRAY</code>, the parser is advanced to
 the corresponding <code>END_ARRAY</code>.
 If the parser is not in any array context, nothing happens.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
</dl>
</li>
</ul>
<a name="skipObject--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>skipObject</h4>
<pre>default&nbsp;void&nbsp;skipObject()</pre>
<div class="block">Advance the parser to <code>END_OBJECT</code>.
 If the parser is in object context, i.e. it has previously
 encountered a <code>START_OBJECT</code> without encountering the
 corresponding <code>END_OBJECT</code>, the parser is advanced to
 the corresponding <code>END_OBJECT</code>.
 If the parser is not in any object context, nothing happens.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
</dl>
</li>
</ul>
<a name="close--">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>close</h4>
<pre>void&nbsp;close()</pre>
<div class="block">Closes this parser and frees any resources associated with the
 parser. This method closes the underlying input source.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="http://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="http://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="http://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="http://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>
</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="class-use/JsonParser.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/JsonLocation.html" title="interface in javax.json.stream"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../javax/json/stream/JsonParser.Event.html" title="enum 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/JsonParser.html" target="_top">Frames</a></li>
<li><a href="JsonParser.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><a href="#nested.class.summary">Nested</a>&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 ======= -->
<p class="legalCopy"><small>Copyright &#169; 1996-2017,     <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>.</small></p>
</body>
</html>
