public interface JSONContentHandler
A simplified and stoppable SAX-like content handler for stream processing of JSON text.
- Since:
- 1.0.0
- Version:
- 1.0.0
- Author:
- FangYidong(fangyidong@yahoo.com.cn)
- See Also:
-
org.xml.sax.ContentHandlerJSONParser.parse(java.io.Reader, JSONContentHandler, boolean)
-
Method Summary
Modifier and TypeMethodDescriptionbooleanendArray()Receives a notification when a JSON array ends.voidendJSON()Receives a notification when the JSON processing ends.booleanReceives a notification when a JSON object ends.booleanReceives a notification when a JSON entry ends.booleanbooleanReceives a notification when a JSON array begins.voidReceives a notification when the JSON processing begins.booleanReceives a notification when a JSON object begins.booleanstartObjectEntry(String key) Receives a notification when a JSON object entry begins.
-
Method Details
-
startJSON
Receives a notification when the JSON processing begins. The JSONParser will invoke this method only once.- Throws:
JSONParseException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.IOException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.- Since:
- 1.0.0
-
endJSON
Receives a notification when the JSON processing ends.- Throws:
JSONParseException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.IOException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.- Since:
- 1.0.0
-
startObject
Receives a notification when a JSON object begins.- Returns:
falseif the JSONContentHandler wants to stop parsing after return- Throws:
JSONParseException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.IOException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.- Since:
- 1.0.0
- See Also:
-
endObject
Receives a notification when a JSON object ends.- Returns:
falseif the JSONContentHandler wants to stop parsing after return- Throws:
JSONParseException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.IOException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.- Since:
- 1.0.0
- See Also:
-
startObjectEntry
Receives a notification when a JSON object entry begins.- Parameters:
key- name of the object entry- Returns:
falseif the JSONContentHandler wants to stop parsing after return- Throws:
JSONParseException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.IOException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.- Since:
- 1.0.0
- See Also:
-
endObjectEntry
Receives a notification when a JSON entry ends.- Returns:
falseif the JSONContentHandler wants to stop parsing after return- Throws:
JSONParseException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.IOException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.- See Also:
-
startArray
Receives a notification when a JSON array begins.- Returns:
falseif the JSONContentHandler wants to stop parsing after return- Throws:
JSONParseException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.IOException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.- Since:
- 1.0.0
- See Also:
-
endArray
Receives a notification when a JSON array ends.- Returns:
falseif the JSONContentHandler wants to stop parsing after return- Throws:
JSONParseException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.IOException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.- Since:
- 1.0.0
- See Also:
-
primitive
- Parameters:
value- the primitive JSON value- Returns:
falseif the JSONContentHandler wants to stop parsing after return- Throws:
JSONParseException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.IOException- JSONParser will stop and throw the same Exception to the caller when receiving this Exception.- Since:
- 1.0.0
-