- java.lang.Object
-
- org.bluezoo.json.JSONDefaultHandler
-
- All Implemented Interfaces:
JSONContentHandler
public class JSONDefaultHandler extends java.lang.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 Summary
Constructors Constructor Description JSONDefaultHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbooleanValue(boolean value)Notifies of a JSON boolean value.voidendArray()Indicates the end of a JSON array.voidendObject()Indicates the end of a JSON object.voidkey(java.lang.String key)Notifies of a key in a JSON object.voidnullValue()Notifies of a JSON null value.voidnumberValue(java.lang.Number number)Notifies of a JSON number.voidsetLocator(JSONLocator locator)Receive an object that can be used to determine the current location during parsing.voidstartArray()Indicates the start of a JSON array.voidstartObject()Indicates the start of a JSON object.voidstringValue(java.lang.String value)Notifies of a JSON string.voidwhitespace(java.lang.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, wait
-
Methods inherited from interface org.bluezoo.json.JSONContentHandler
needsWhitespace
-
-
-
-
Method Detail
-
startObject
public void startObject() throws JSONExceptionDescription 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
public void endObject() throws JSONExceptionDescription 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
public void startArray() throws JSONExceptionDescription 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
public void endArray() throws JSONExceptionDescription 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
public void numberValue(java.lang.Number number) throws JSONExceptionDescription 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
public void stringValue(java.lang.String value) throws JSONExceptionDescription 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
public void booleanValue(boolean value) throws JSONExceptionDescription 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
public void nullValue() throws JSONExceptionDescription copied from interface:JSONContentHandlerNotifies of a JSON null value.- Specified by:
nullValuein interfaceJSONContentHandler- Throws:
JSONException- the client may throw an exception during processing
-
whitespace
public void whitespace(java.lang.String whitespace) throws JSONExceptionDescription 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
public void key(java.lang.String key) throws JSONExceptionDescription 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
public void setLocator(JSONLocator locator)
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
-
-