Code example for JsonReader

Methods: setLenient

0
   * {@code JsonReader} and call {@link #read(JsonReader)} for lenient reading. 
   * 
   * @return the converted Java object. May be null. 
   */ 
  /*public*/ final T fromJson(Reader in) throws IOException {
    JsonReader reader = new JsonReader(in);
    reader.setLenient(true); // TODO: non-lenient?
    return read(reader);
  } 
 
  /** 
   * Converts the JSON document in {@code json} to a Java object. Unlike Gson's 
   * similar {@link Gson#fromJson(String, Class) fromJson} method, this read is 
   * strict. Create a {@link JsonReader#setLenient(boolean) lenient} {@code 
   * JsonReader} and call {@link #read(JsonReader)} for lenient reading. 
   * 
   * @return the converted Java object. May be null. 
   */ 
  /*public*/ final T fromJson(String json) throws IOException {
    return fromJson(new StringReader(json));