Class JsonParser
java.lang.Object
com.google.gson.JsonParser
A parser to parse Json into a parse tree of
JsonElements- Since:
- 1.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparse(JsonReader json) Returns the next value from the JSON stream as a parse tree.Parses the specified JSON string into a parse treeParses the specified JSON string into a parse tree
-
Constructor Details
-
JsonParser
public JsonParser()
-
-
Method Details
-
parse
Parses the specified JSON string into a parse tree- Parameters:
json- JSON text- Returns:
- a parse tree of
JsonElements corresponding to the specified JSON - Throws:
JsonParseException- if the specified text is not valid JSONJsonSyntaxException- Since:
- 1.3
-
parse
Parses the specified JSON string into a parse tree- Parameters:
json- JSON text- Returns:
- a parse tree of
JsonElements corresponding to the specified JSON - Throws:
JsonParseException- if the specified text is not valid JSONJsonIOExceptionJsonSyntaxException- Since:
- 1.3
-
parse
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 JSONJsonIOExceptionJsonSyntaxException- Since:
- 1.6
-