Package org.drip.service.jsonparser
Interface ContentHandler
public interface ContentHandler
ContentHandler is an Adaptation of the ContentHandler Interface from the RFC4627 compliant JSON
Simple (https://code.google.com/p/json-simple/).
- Module = Computational Core Module
- Library = Computation Support
- Project = Environment, Product/Definition Containers, and Scenario/State Manipulation APIs
- Package = RFC4627 Compliant JSON Message Parser
- Author:
- Fang Yidong, Lakshmi Krishnamurthy
-
Method Summary
Modifier and Type Method Description boolean
endArray()
Receive notification of the end of a JSON array.void
endJSON()
Receive notification of the end of JSON processing.boolean
endObject()
Receive notification of the end of a JSON object.boolean
endObjectEntry()
Receive notification of the end of the value of previous object entry.boolean
primitive(java.lang.Object value)
Receive notification of the JSON primitive values: java.lang.String, java.lang.Number, java.lang.Boolean nullboolean
startArray()
Receive notification of the beginning of a JSON array.void
startJSON()
Receive notification of the beginning of JSON processing.boolean
startObject()
Receive notification of the beginning of a JSON object.boolean
startObjectEntry(java.lang.String key)
Receive notification of the beginning of a JSON object entry.
-
Method Details
-
startJSON
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.java.io.IOException
- JSONParser will stop and throw the same exception to the caller when receiving this exception.
-
endJSON
Receive notification of the end of JSON processing.- Throws:
ParseException
- JSONParser will stop and throw the same exception to the caller when receiving this exception.java.io.IOException
- JSONParser will stop and throw the same exception to the caller when receiving this exception.
-
startObject
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.java.io.IOException
- JSONParser will stop and throw the same exception to the caller when receiving this exception.- See Also:
endJSON()
-
endObject
Receive notification of the end 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.java.io.IOException
- JSONParser will stop and throw the same exception to the caller when receiving this exception.- See Also:
startObject()
-
startObjectEntry
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
- JSONParser will stop and throw the same exception to the caller when receiving this exception.java.io.IOException
- JSONParser will stop and throw the same exception to the caller when receiving this exception.- See Also:
endObjectEntry()
-
endObjectEntry
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
- JSONParser will stop and throw the same exception to the caller when receiving this exception.java.io.IOException
- JSONParser will stop and throw the same exception to the caller when receiving this exception.- See Also:
startObjectEntry(java.lang.String)
-
startArray
Receive notification of the beginning of a JSON array.- 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.java.io.IOException
- JSONParser will stop and throw the same exception to the caller when receiving this exception.- See Also:
endArray()
-
endArray
Receive notification of the end of a JSON array.- 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.java.io.IOException
- JSONParser will stop and throw the same exception to the caller when receiving this exception.- See Also:
startArray()
-
primitive
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
- JSONParser will stop and throw the same exception to the caller when receiving this exception.java.io.IOException
- JSONParser will stop and throw the same exception to the caller when receiving this exception.
-