com.google.gson
Class JsonParser

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

public final class JsonParser
extends Object

A parser to parse Json into a parse tree of JsonElements

Since:
1.3
Author:
Inderjeet Singh, Joel Leitch

Constructor Summary
JsonParser()
           
 
Method Summary
static JsonElement parse(Reader json)
          Parses the specified JSON string into a parse tree
static JsonElement parse(String json)
          Parses the specified JSON string into a parse tree
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonParser

public JsonParser()
Method Detail

parse

public static JsonElement parse(String json)
                         throws JsonParseException
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 JSON
Since:
1.3

parse

public static JsonElement parse(Reader json)
                         throws JsonParseException
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 JSON
Since:
1.3


Copyright © 2008-2009. All Rights Reserved.