JsonParser (Gson 2.3.1 API)
Date: 2014-11-20

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.gson
Class JsonParser

    java.lang.Object
      com.google.gson.JsonParser

    public final class JsonParser

extends Object

A parser to parse Json into a parse tree of `JsonElement`s

Since:
  1.3
Author:
  Inderjeet Singh, Joel Leitch

Constructor Summary
`JsonParser()`

Method Summary
`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

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JsonParser

    public JsonParser()

Method Detail

### parse

    public JsonElement parse(String json)
                      throws JsonSyntaxException

  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 JSON
    `JsonSyntaxException`
  Since:
    1.3

### parse

    public JsonElement parse(Reader json)
                      throws JsonIOException,
                             JsonSyntaxException

  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 JSON
    `JsonIOException`
    `JsonSyntaxException`
  Since:
    1.3

### parse

    public JsonElement parse(JsonReader json)
                      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 JSON
    `JsonIOException`
    `JsonSyntaxException`
  Since:
    1.6

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008–2014 Google, Inc.. All rights reserved.