Package com.google.gson
Class JsonParser
java.lang.Object
com.google.gson.JsonParser
A parser to parse Json into a parse tree of
JsonElement
s- Since:
- 1.3
- Author:
- Inderjeet Singh, Joel Leitch
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.No need to instantiate this class, use the static methods instead. -
Method Summary
Modifier and TypeMethodDescriptionparse
(JsonReader json) Deprecated.Deprecated.Deprecated.static JsonElement
parseReader
(JsonReader reader) Returns the next value from the JSON stream as a parse tree.static JsonElement
parseReader
(Reader reader) Parses the specified JSON string into a parse treestatic JsonElement
parseString
(String json) Parses the specified JSON string into a parse tree
-
Constructor Details
-
JsonParser
Deprecated.No need to instantiate this class, use the static methods instead.
-
-
Method Details
-
parseString
Parses the specified JSON string into a parse tree- Parameters:
json
- JSON text- Returns:
- a parse tree of
JsonElement
s corresponding to the specified JSON - Throws:
JsonParseException
- if the specified text is not valid JSONJsonSyntaxException
-
parseReader
Parses the specified JSON string into a parse tree- Parameters:
reader
- JSON text- Returns:
- a parse tree of
JsonElement
s corresponding to the specified JSON - Throws:
JsonParseException
- if the specified text is not valid JSONJsonIOException
JsonSyntaxException
-
parseReader
public static JsonElement parseReader(JsonReader reader) throws JsonIOException, JsonSyntaxException Returns the next value from the JSON stream as a parse tree.- Throws:
JsonParseException
- if there is an IOException or if the specified text is not valid JSONJsonIOException
JsonSyntaxException
-
parse
Deprecated.- Throws:
JsonSyntaxException
-
parse
Deprecated.- Throws:
JsonIOException
JsonSyntaxException
-
parse
Deprecated.- Throws:
JsonIOException
JsonSyntaxException
-