JsonElement.java
3.25 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
package com.google.gson;
import com.google.gson.internal.Streams;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.math.BigDecimal;
import java.math.BigInteger;
public abstract class JsonElement
{
public BigDecimal getAsBigDecimal()
{
throw new UnsupportedOperationException(getClass().getSimpleName());
}
public BigInteger getAsBigInteger()
{
throw new UnsupportedOperationException(getClass().getSimpleName());
}
public boolean getAsBoolean()
{
throw new UnsupportedOperationException(getClass().getSimpleName());
}
public byte getAsByte()
{
throw new UnsupportedOperationException(getClass().getSimpleName());
}
public char getAsCharacter()
{
throw new UnsupportedOperationException(getClass().getSimpleName());
}
public double getAsDouble()
{
throw new UnsupportedOperationException(getClass().getSimpleName());
}
public float getAsFloat()
{
throw new UnsupportedOperationException(getClass().getSimpleName());
}
public int getAsInt()
{
throw new UnsupportedOperationException(getClass().getSimpleName());
}
public JsonArray getAsJsonArray()
{
if (isJsonArray()) {
return (JsonArray)this;
}
throw new IllegalStateException("This is not a JSON Array.");
}
public JsonNull getAsJsonNull()
{
if (isJsonNull()) {
return (JsonNull)this;
}
throw new IllegalStateException("This is not a JSON Null.");
}
public JsonObject getAsJsonObject()
{
if (isJsonObject()) {
return (JsonObject)this;
}
throw new IllegalStateException("Not a JSON Object: " + this);
}
public JsonPrimitive getAsJsonPrimitive()
{
if (isJsonPrimitive()) {
return (JsonPrimitive)this;
}
throw new IllegalStateException("This is not a JSON Primitive.");
}
public long getAsLong()
{
throw new UnsupportedOperationException(getClass().getSimpleName());
}
public Number getAsNumber()
{
throw new UnsupportedOperationException(getClass().getSimpleName());
}
public short getAsShort()
{
throw new UnsupportedOperationException(getClass().getSimpleName());
}
public String getAsString()
{
throw new UnsupportedOperationException(getClass().getSimpleName());
}
public boolean isJsonArray()
{
return this instanceof JsonArray;
}
public boolean isJsonNull()
{
return this instanceof JsonNull;
}
public boolean isJsonObject()
{
return this instanceof JsonObject;
}
public boolean isJsonPrimitive()
{
return this instanceof JsonPrimitive;
}
public String toString()
{
try
{
Object localObject = new StringWriter();
JsonWriter localJsonWriter = new JsonWriter((Writer)localObject);
localJsonWriter.setLenient(true);
Streams.write(this, localJsonWriter);
localObject = ((StringWriter)localObject).toString();
return (String)localObject;
}
catch (IOException localIOException)
{
throw new AssertionError(localIOException);
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/gson/JsonElement.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/