public final class JsonParser extends Object
JsonElement
s构造器和说明 |
---|
JsonParser() |
限定符和类型 | 方法和说明 |
---|---|
JsonElement |
parse(JsonReader json)
Returns the next value from the JSON stream as a parse tree.
|
JsonElement |
parse(Reader json)
Parses the specified JSON string into a parse tree
|
JsonElement |
parse(String json)
Parses the specified JSON string into a parse tree
|
public JsonElement parse(String json) throws JsonSyntaxException
json
- JSON textJsonElement
s corresponding to the specified JSONJsonParseException
- if the specified text is not valid JSONJsonSyntaxException
public JsonElement parse(Reader json) throws JsonIOException, JsonSyntaxException
json
- JSON textJsonElement
s corresponding to the specified JSONJsonParseException
- if the specified text is not valid JSONJsonIOException
JsonSyntaxException
public JsonElement parse(JsonReader json) throws JsonIOException, JsonSyntaxException
JsonParseException
- if there is an IOException or if the specified
text is not valid JSONJsonIOException
JsonSyntaxException