<DT><B>All Implemented Interfaces:</B><DD><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Iterator.html?is-external=true"title="class or interface in java.util">Iterator</A><<AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson">JsonElement</A>></DD>
<DT><PRE>public final class <B>JsonStreamParser</B><DT>extends <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A><DT>implements <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Iterator.html?is-external=true"title="class or interface in java.util">Iterator</A><<AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson">JsonElement</A>></DL>
A streaming parser that allows reading of multiple <AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson"><CODE>JsonElement</CODE></A>s from the specified reader
asynchronously.
<p>This class is conditionally thread-safe (see Item 70, Effective Java second edition). To
properly use this class across multiple threads, you will need to add some external
synchronization. For example:
<pre>
JsonStreamParser parser = new JsonStreamParser("['first'] {'second':10} 'third'");
JsonElement element;
synchronized (parser) { // synchronize on an object shared by threads
<TD><CODE><B><AHREF="../../../com/google/gson/JsonStreamParser.html#JsonStreamParser(java.io.Reader)">JsonStreamParser</A></B>(<AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Reader.html?is-external=true"title="class or interface in java.io">Reader</A> reader)</CODE>
<TD><CODE><B><AHREF="../../../com/google/gson/JsonStreamParser.html#JsonStreamParser(java.lang.String)">JsonStreamParser</A></B>(<AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A> json)</CODE>
Returns true if a <AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson"><CODE>JsonElement</CODE></A> is available on the input for consumption</TD>
Returns the next available <AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson"><CODE>JsonElement</CODE></A> on the reader.</TD>
This optional <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Iterator.html?is-external=true"title="class or interface in java.util"><CODE>Iterator</CODE></A> method is not relevant for stream parsing and hence is not
<THALIGN="left"><B>Methods inherited from class java.lang.<AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true"title="class or interface in java.lang">Object</A></B></TH>
<TD><CODE><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)"title="class or interface in java.lang">equals</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()"title="class or interface in java.lang">getClass</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()"title="class or interface in java.lang">hashCode</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()"title="class or interface in java.lang">notify</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()"title="class or interface in java.lang">notifyAll</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()"title="class or interface in java.lang">toString</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()"title="class or interface in java.lang">wait</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)"title="class or interface in java.lang">wait</A>, <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)"title="class or interface in java.lang">wait</A></CODE></TD>
public <B>JsonStreamParser</B>(<AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true"title="class or interface in java.lang">String</A> json)</PRE>
public <B>JsonStreamParser</B>(<AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Reader.html?is-external=true"title="class or interface in java.io">Reader</A> reader)</PRE>
public <AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson">JsonElement</A><B>next</B>()
throws <AHREF="../../../com/google/gson/JsonParseException.html"title="class in com.google.gson">JsonParseException</A></PRE>
<DL>
<DD>Returns the next available <AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson"><CODE>JsonElement</CODE></A> on the reader. Null if none available.
<DT><B>Specified by:</B><DD><CODE><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Iterator.html?is-external=true#next()"title="class or interface in java.util">next</A></CODE> in interface <CODE><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Iterator.html?is-external=true"title="class or interface in java.util">Iterator</A><<AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson">JsonElement</A>></CODE></DL>
<DT><B>Returns:</B><DD>the next available <AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson"><CODE>JsonElement</CODE></A> on the reader. Null if none available.
<DT><B>Throws:</B>
<DD><CODE><AHREF="../../../com/google/gson/JsonParseException.html"title="class in com.google.gson">JsonParseException</A></CODE> - if the incoming stream is malformed JSON.<DT><B>Since:</B></DT>
<DD>1.4</DD>
</DL>
</DD>
</DL>
<HR>
<ANAME="hasNext()"><!----></A><H3>
hasNext</H3>
<PRE>
public boolean <B>hasNext</B>()</PRE>
<DL>
<DD>Returns true if a <AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson"><CODE>JsonElement</CODE></A> is available on the input for consumption
<DT><B>Specified by:</B><DD><CODE><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Iterator.html?is-external=true#hasNext()"title="class or interface in java.util">hasNext</A></CODE> in interface <CODE><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Iterator.html?is-external=true"title="class or interface in java.util">Iterator</A><<AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson">JsonElement</A>></CODE></DL>
<DT><B>Returns:</B><DD>true if a <AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson"><CODE>JsonElement</CODE></A> is available on the input, false otherwise<DT><B>Since:</B></DT>
<DD>This optional <AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Iterator.html?is-external=true"title="class or interface in java.util"><CODE>Iterator</CODE></A> method is not relevant for stream parsing and hence is not
<DT><B>Specified by:</B><DD><CODE><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Iterator.html?is-external=true#remove()"title="class or interface in java.util">remove</A></CODE> in interface <CODE><AHREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Iterator.html?is-external=true"title="class or interface in java.util">Iterator</A><<AHREF="../../../com/google/gson/JsonElement.html"title="class in com.google.gson">JsonElement</A>></CODE></DL>