Code example for JsonReader

Methods: setLenient

0
  /** 
   * @param reader The data stream containing JSON elements concatenated to each other. 
   * @since 1.4 
   */ 
  public JsonStreamParser(Reader reader) {
    parser = new JsonReader(reader);
    parser.setLenient(true);
    lock = new Object();
  } 
   
  /** 
   * Returns the next available {@link JsonElement} on the reader. Null if none available. 
   *  
   * @return the next available {@link JsonElement} on the reader. Null if none available. 
   * @throws JsonParseException if the incoming stream is malformed JSON. 
   * @since 1.4 
   */ 
  public JsonElement next() throws JsonParseException {
    if (!hasNext()) {
      throw new NoSuchElementException();