Documentation of 'org.jlab.hipo.json.JsonParser' Java class
JsonParser
org.jlab.hipo.json

Class JsonParser



  • public class JsonParser
    extends java.lang.Object
    A streaming parser for JSON text. The parser reports all events to a given handler.
    • Constructor Summary

      Constructors 
      Constructor and Description
      JsonParser(JsonHandler<?,?> handler)
      Creates a new JsonParser with the given handler.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void parse(java.io.Reader reader)
      Reads the entire input from the given reader and parses it as JSON.
      void parse(java.io.Reader reader, int buffersize)
      Reads the entire input from the given reader and parses it as JSON.
      void parse(java.lang.String string)
      Parses the given input string.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonParser

        public JsonParser(JsonHandler<?,?> handler)
        Creates a new JsonParser with the given handler. The parser will report all parser events to this handler.
        Parameters:
        handler - the handler to process parser events
    • Method Detail

      • parse

        public void parse(java.lang.String string)
        Parses the given input string. The input must contain a valid JSON value, optionally padded with whitespace.
        Parameters:
        string - the input string, must be valid JSON
        Throws:
        ParseException - if the input is not valid JSON
      • parse

        public void parse(java.io.Reader reader)
                   throws java.io.IOException
        Reads the entire input from the given reader and parses it as JSON. The input must contain a valid JSON value, optionally padded with whitespace.

        Characters are read in chunks into a default-sized input buffer. Hence, wrapping a reader in an additional BufferedReader likely won't improve reading performance.

        Parameters:
        reader - the reader to read the input from
        Throws:
        java.io.IOException - if an I/O error occurs in the reader
        ParseException - if the input is not valid JSON
      • parse

        public void parse(java.io.Reader reader,
                          int buffersize)
                   throws java.io.IOException
        Reads the entire input from the given reader and parses it as JSON. The input must contain a valid JSON value, optionally padded with whitespace.

        Characters are read in chunks into an input buffer of the given size. Hence, wrapping a reader in an additional BufferedReader likely won't improve reading performance.

        Parameters:
        reader - the reader to read the input from
        buffersize - the size of the input buffer in chars
        Throws:
        java.io.IOException - if an I/O error occurs in the reader
        ParseException - if the input is not valid JSON

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.