java.lang.Object
org.bluezoo.json.JSONDefaultHandler
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanValue(boolean value) Notifies of a JSON boolean value.voidendArray()Indicates the end of a JSON array.voidIndicates the end of a JSON object.voidNotifies of a key in a JSON object.voidNotifies of a JSON null value.voidnumberValue(Number number) Notifies of a JSON number.voidsetLocator(JSONLocator locator) Receive an object that can be used to determine the current location during parsing.voidIndicates the start of a JSON array.voidIndicates the start of a JSON object.voidstringValue(String value) Notifies of a JSON string.voidwhitespace(String whitespace) Notifies of whitespace in the underlying stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bluezoo.json.JSONContentHandler
needsWhitespace
-
Constructor Details
-
JSONDefaultHandler
public JSONDefaultHandler()
-
-
Method Details
-
startObject
Description copied from interface:JSONContentHandlerIndicates the start of a JSON object.- Specified by:
startObjectin interfaceJSONContentHandler- Throws:
JSONException- the client may throw an exception during processing
-
endObject
Description copied from interface:JSONContentHandlerIndicates the end of a JSON object.- Specified by:
endObjectin interfaceJSONContentHandler- Throws:
JSONException- the client may throw an exception during processing
-
startArray
Description copied from interface:JSONContentHandlerIndicates the start of a JSON array.- Specified by:
startArrayin interfaceJSONContentHandler- Throws:
JSONException- the client may throw an exception during processing
-
endArray
Description copied from interface:JSONContentHandlerIndicates the end of a JSON array.- Specified by:
endArrayin interfaceJSONContentHandler- Throws:
JSONException- the client may throw an exception during processing
-
numberValue
Description copied from interface:JSONContentHandlerNotifies of a JSON number.- Specified by:
numberValuein interfaceJSONContentHandler- Parameters:
number- the number parsed: may be an Integer, Long, or Double- Throws:
JSONException- the client may throw an exception during processing
-
stringValue
Description copied from interface:JSONContentHandlerNotifies of a JSON string.- Specified by:
stringValuein interfaceJSONContentHandler- Parameters:
value- the string value, unescaped and unquoted- Throws:
JSONException- the client may throw an exception during processing
-
booleanValue
Description copied from interface:JSONContentHandlerNotifies of a JSON boolean value.- Specified by:
booleanValuein interfaceJSONContentHandler- Parameters:
value- the boolean value- Throws:
JSONException- the client may throw an exception during processing
-
nullValue
Description copied from interface:JSONContentHandlerNotifies of a JSON null value.- Specified by:
nullValuein interfaceJSONContentHandler- Throws:
JSONException- the client may throw an exception during processing
-
whitespace
Description copied from interface:JSONContentHandlerNotifies 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:
whitespacein interfaceJSONContentHandler- Parameters:
whitespace- the whitespace contents as a string- Throws:
JSONException- the client may throw an exception during processing
-
key
Description copied from interface:JSONContentHandlerNotifies 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:
keyin interfaceJSONContentHandler- Parameters:
key- the key name- Throws:
JSONException- the client may throw an exception during processing
-
setLocator
Description copied from interface:JSONContentHandlerReceive 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:
setLocatorin interfaceJSONContentHandler- Parameters:
locator- the locator object
-