Interface ContentHandler


public interface ContentHandler
A simplified and stoppable SAX-like content handler for stream processing of JSON text.
Author:
(originally) FangYidong [email protected]
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Receive notification of the end of a JSON array.
    void
    Receive notification of the end of JSON processing.
    boolean
    Receive notification of the end of a JSON object.
    boolean
    Receive notification of the end of the value of previous object entry.
    boolean
    Receive notification of the JSON primitive values: java.lang.String, java.lang.Number, java.lang.Boolean null
    boolean
    Receive notification of the beginning of a JSON array.
    void
    Receive notification of the beginning of JSON processing.
    boolean
    Receive notification of the beginning of a JSON object.
    boolean
    Receive notification of the beginning of a JSON object entry.
  • Method Details

    • startJSON

      void startJSON() throws ParseException, IOException
      Receive notification of the beginning of JSON processing. The parser will invoke this method only once.
      Throws:
      ParseException - - JSONParser will stop and throw the same exception to the caller when receiving this exception.
      IOException - IOException
    • endJSON

      void endJSON() throws ParseException, IOException
      Receive notification of the end of JSON processing.
      Throws:
      ParseException - ParseException
      IOException - IOException
    • startObject

      boolean startObject() throws ParseException, IOException
      Receive notification of the beginning of a JSON object.
      Returns:
      false if the handler wants to stop parsing after return.
      Throws:
      ParseException - - JSONParser will stop and throw the same exception to the caller when receiving this exception.
      IOException - IOException
      See Also:
    • endObject

      boolean endObject() throws ParseException, IOException
      Receive notification of the end of a JSON object.
      Returns:
      false if the handler wants to stop parsing after return.
      Throws:
      ParseException - ParseException
      IOException - IOException
      See Also:
    • startObjectEntry

      boolean startObjectEntry(String key) throws ParseException, IOException
      Receive notification of the beginning of a JSON object entry.
      Parameters:
      key - - Key of a JSON object entry.
      Returns:
      false if the handler wants to stop parsing after return.
      Throws:
      ParseException - ParseException
      IOException - IOException
      See Also:
    • endObjectEntry

      boolean endObjectEntry() throws ParseException, IOException
      Receive notification of the end of the value of previous object entry.
      Returns:
      false if the handler wants to stop parsing after return.
      Throws:
      ParseException - ParseException
      IOException - IOException
      See Also:
    • startArray

      boolean startArray() throws ParseException, IOException
      Receive notification of the beginning of a JSON array.
      Returns:
      false if the handler wants to stop parsing after return.
      Throws:
      ParseException - ParseException
      IOException - IOException
      See Also:
    • endArray

      boolean endArray() throws ParseException, IOException
      Receive notification of the end of a JSON array.
      Returns:
      false if the handler wants to stop parsing after return.
      Throws:
      ParseException - ParseException
      IOException - IOException
      See Also:
    • primitive

      boolean primitive(Object value) throws ParseException, IOException
      Receive notification of the JSON primitive values: java.lang.String, java.lang.Number, java.lang.Boolean null
      Parameters:
      value - - Instance of the following: java.lang.String, java.lang.Number, java.lang.Boolean null
      Returns:
      false if the handler wants to stop parsing after return.
      Throws:
      ParseException - ParseException
      IOException - IOException