com.orsoncharts.util.json.parser

## Class JSONParser

- java.lang.Object
- - com.orsoncharts.util.json.parser.JSONParser

-     public class JSONParser
      extends java.lang.Object

  Parser for JSON text. Please note that JSONParser is NOT thread-safe.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `S_END`
    `static int` | `S_IN_ARRAY`
    `static int` | `S_IN_ERROR`
    `static int` | `S_IN_FINISHED_VALUE`
    `static int` | `S_IN_OBJECT`
    `static int` | `S_IN_PAIR_VALUE`
    `static int` | `S_INIT`
    `static int` | `S_PASSED_PAIR_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JSONParser()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getPosition()`
    `java.lang.Object` | `parse(java.io.Reader in)`
    `java.lang.Object` | `parse(java.io.Reader in, ContainerFactory containerFactory)` Parse JSON text into java object from the input source.
    `void` | `parse(java.io.Reader in, ContentHandler contentHandler)`
    `void` | `parse(java.io.Reader in, ContentHandler contentHandler, boolean isResume)` Stream processing of JSON text.
    `java.lang.Object` | `parse(java.lang.String s)`
    `java.lang.Object` | `parse(java.lang.String s, ContainerFactory containerFactory)`
    `void` | `parse(java.lang.String s, ContentHandler contentHandler)`
    `void` | `parse(java.lang.String s, ContentHandler contentHandler, boolean isResume)`
    `void` | `reset()` Reset the parser to the initial state without resetting the underlying reader.
    `void` | `reset(java.io.Reader in)` Reset the parser to the initial state with a new character reader.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### S_INIT

          public static final int S_INIT

      See Also:
        Constant Field Values

    - #### S_IN_FINISHED_VALUE

          public static final int S_IN_FINISHED_VALUE

      See Also:
        Constant Field Values

    - #### S_IN_OBJECT

          public static final int S_IN_OBJECT

      See Also:
        Constant Field Values

    - #### S_IN_ARRAY

          public static final int S_IN_ARRAY

      See Also:
        Constant Field Values

    - #### S_PASSED_PAIR_KEY

          public static final int S_PASSED_PAIR_KEY

      See Also:
        Constant Field Values

    - #### S_IN_PAIR_VALUE

          public static final int S_IN_PAIR_VALUE

      See Also:
        Constant Field Values

    - #### S_END

          public static final int S_END

      See Also:
        Constant Field Values

    - #### S_IN_ERROR

          public static final int S_IN_ERROR

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JSONParser

          public JSONParser()

  - ### Method Detail

    - #### reset

          public void reset()

      Reset the parser to the initial state without resetting the underlying reader.

    - #### reset

          public void reset(java.io.Reader in)

      Reset the parser to the initial state with a new character reader.
      Parameters:
        `in` - the new character reader.

    - #### getPosition

          public int getPosition()

      Returns:
        The position of the beginning of the current token.

    - #### parse

          public java.lang.Object parse(java.lang.String s)
                                 throws ParseException

      Throws:
        `ParseException`

    - #### parse

          public java.lang.Object parse(java.lang.String s,
                                        ContainerFactory containerFactory)
                                 throws ParseException

      Throws:
        `ParseException`

    - #### parse

          public java.lang.Object parse(java.io.Reader in)
                                 throws java.io.IOException,
                                        ParseException

      Throws:
        `java.io.IOException`
        `ParseException`

    - #### parse

          public java.lang.Object parse(java.io.Reader in,
                                        ContainerFactory containerFactory)
                                 throws java.io.IOException,
                                        ParseException

      Parse JSON text into java object from the input source.
      Parameters:
        `in` - the input source.
        `containerFactory` - use this factory to create your own JSON object and JSON array containers.
      Returns:
        Instance of the following: com.orsoncharts.util.json.simple.JSONObject, com.orsoncharts.util.json.simple.JSONArray, java.lang.String, java.lang.Number, java.lang.Boolean, null
      Throws:
        `java.io.IOException` - if there is an I/O problem.
        `ParseException` - if there is a parsing problem.

    - #### parse

          public void parse(java.lang.String s,
                            ContentHandler contentHandler)
                     throws ParseException

      Throws:
        `ParseException`

    - #### parse

          public void parse(java.lang.String s,
                            ContentHandler contentHandler,
                            boolean isResume)
                     throws ParseException

      Throws:
        `ParseException`

    - #### parse

          public void parse(java.io.Reader in,
                            ContentHandler contentHandler)
                     throws java.io.IOException,
                            ParseException

      Throws:
        `java.io.IOException`
        `ParseException`

    - #### parse

          public void parse(java.io.Reader in,
                            ContentHandler contentHandler,
                            boolean isResume)
                     throws java.io.IOException,
                            ParseException

      Stream processing of JSON text.
      Parameters:
        `in` - the input.
        `contentHandler` - the content handler.
        `isResume` - indicates if it continues previous parsing operation. If set to true, resume parsing the old stream, and parameter 'in' will be ignored. If this method is called for the first time in this instance, isResume will be ignored.
      Throws:
        `java.io.IOException` - if there is an I/O problem.
        `ParseException` - if there is a parsing problem.
      See Also:
        `ContentHandler`