JsonStreamParser.java
2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package com.google.gson;
import com.google.gson.internal.Streams;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.MalformedJsonException;
import java.io.EOFException;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.util.Iterator;
import java.util.NoSuchElementException;
public final class JsonStreamParser
implements Iterator<JsonElement>
{
private final JsonReader a;
private final Object b;
public JsonStreamParser(Reader paramReader)
{
this.a = new JsonReader(paramReader);
this.a.setLenient(true);
this.b = new Object();
}
public JsonStreamParser(String paramString)
{
this(new StringReader(paramString));
}
public final boolean hasNext()
{
for (;;)
{
try
{
synchronized (this.b)
{
try
{
JsonToken localJsonToken1 = this.a.peek();
JsonToken localJsonToken2 = JsonToken.END_DOCUMENT;
if (localJsonToken1 != localJsonToken2)
{
bool = true;
return bool;
}
}
catch (MalformedJsonException localMalformedJsonException)
{
throw new JsonSyntaxException(localMalformedJsonException);
}
}
boolean bool = false;
}
catch (IOException localIOException)
{
throw new JsonIOException(localIOException);
}
}
}
public final JsonElement next()
throws JsonParseException
{
if (!hasNext()) {
throw new NoSuchElementException();
}
try
{
JsonElement localJsonElement = Streams.parse(this.a);
return localJsonElement;
}
catch (StackOverflowError localStackOverflowError)
{
throw new JsonParseException("Failed parsing JSON source to Json", localStackOverflowError);
}
catch (OutOfMemoryError localOutOfMemoryError)
{
throw new JsonParseException("Failed parsing JSON source to Json", localOutOfMemoryError);
}
catch (JsonParseException localJsonParseException)
{
Object localObject = localJsonParseException;
if ((localJsonParseException.getCause() instanceof EOFException)) {
localObject = new NoSuchElementException();
}
throw ((Throwable)localObject);
}
}
public final void remove()
{
throw new UnsupportedOperationException();
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/gson/JsonStreamParser.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/