Class JSONDefaultHandler

java.lang.Object
org.bluezoo.json.JSONDefaultHandler
All Implemented Interfaces:
JSONContentHandler

public class JSONDefaultHandler extends Object implements JSONContentHandler
Default implementation for the JSONContentHandler interface. This implementation does nothing. It is simply intented to be a convenient class to subclass if you only want to implement a subset of the JSONContentHandler methods.
Author:
Chris Burdess
  • Constructor Details

    • JSONDefaultHandler

      public JSONDefaultHandler()
  • Method Details

    • startObject

      public void startObject() throws JSONException
      Description copied from interface: JSONContentHandler
      Indicates the start of a JSON object.
      Specified by:
      startObject in interface JSONContentHandler
      Throws:
      JSONException - the client may throw an exception during processing
    • endObject

      public void endObject() throws JSONException
      Description copied from interface: JSONContentHandler
      Indicates the end of a JSON object.
      Specified by:
      endObject in interface JSONContentHandler
      Throws:
      JSONException - the client may throw an exception during processing
    • startArray

      public void startArray() throws JSONException
      Description copied from interface: JSONContentHandler
      Indicates the start of a JSON array.
      Specified by:
      startArray in interface JSONContentHandler
      Throws:
      JSONException - the client may throw an exception during processing
    • endArray

      public void endArray() throws JSONException
      Description copied from interface: JSONContentHandler
      Indicates the end of a JSON array.
      Specified by:
      endArray in interface JSONContentHandler
      Throws:
      JSONException - the client may throw an exception during processing
    • numberValue

      public void numberValue(Number number) throws JSONException
      Description copied from interface: JSONContentHandler
      Notifies of a JSON number.
      Specified by:
      numberValue in interface JSONContentHandler
      Parameters:
      number - the number parsed: may be an Integer, Long, or Double
      Throws:
      JSONException - the client may throw an exception during processing
    • stringValue

      public void stringValue(String value) throws JSONException
      Description copied from interface: JSONContentHandler
      Notifies of a JSON string.
      Specified by:
      stringValue in interface JSONContentHandler
      Parameters:
      value - the string value, unescaped and unquoted
      Throws:
      JSONException - the client may throw an exception during processing
    • booleanValue

      public void booleanValue(boolean value) throws JSONException
      Description copied from interface: JSONContentHandler
      Notifies of a JSON boolean value.
      Specified by:
      booleanValue in interface JSONContentHandler
      Parameters:
      value - the boolean value
      Throws:
      JSONException - the client may throw an exception during processing
    • nullValue

      public void nullValue() throws JSONException
      Description copied from interface: JSONContentHandler
      Notifies of a JSON null value.
      Specified by:
      nullValue in interface JSONContentHandler
      Throws:
      JSONException - the client may throw an exception during processing
    • whitespace

      public void whitespace(String whitespace) throws JSONException
      Description copied from interface: JSONContentHandler
      Notifies of whitespace in the underlying stream. Note that whitespace between key strings and their associated colon, if present, will not be reported by this method.
      Specified by:
      whitespace in interface JSONContentHandler
      Parameters:
      whitespace - the whitespace contents as a string
      Throws:
      JSONException - the client may throw an exception during processing
    • key

      public void key(String key) throws JSONException
      Description copied from interface: JSONContentHandler
      Notifies of a key in a JSON object. This is a string followed by a colon inside an object representation in the JSON source. It will always be associated with the most recent previous startObject event.
      Specified by:
      key in interface JSONContentHandler
      Parameters:
      key - the key name
      Throws:
      JSONException - the client may throw an exception during processing
    • setLocator

      public void setLocator(JSONLocator locator)
      Description copied from interface: JSONContentHandler
      Receive an object that can be used to determine the current location during parsing. The locator allows the application to determine the end position of any parsing-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules).
      Specified by:
      setLocator in interface JSONContentHandler
      Parameters:
      locator - the locator object