org.json.simple.parser
接口 ContentHandler


public interface ContentHandler

A simplified and stoppable SAX-like content handler for stream processing of JSON text.

作者:
FangYidong
另请参见:
org.xml.sax.ContentHandler, JSONParser.parse(java.io.Reader, ContentHandler, boolean)

方法摘要
 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 null
 boolean 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.
 

方法详细信息

startJSON

void startJSON()
               throws ParseException,
                      java.io.IOException
Receive notification of the beginning of JSON processing. The parser will invoke this method only once.

抛出:
ParseException - - JSONParser will stop and throw the same exception to the caller when receiving this exception.
java.io.IOException

endJSON

void endJSON()
             throws ParseException,
                    java.io.IOException
Receive notification of the end of JSON processing.

抛出:
ParseException
java.io.IOException

startObject

boolean startObject()
                    throws ParseException,
                           java.io.IOException
Receive notification of the beginning of a JSON object.

返回:
false if the handler wants to stop parsing after return.
抛出:
ParseException - - JSONParser will stop and throw the same exception to the caller when receiving this exception.
java.io.IOException
另请参见:
endJSON()

endObject

boolean endObject()
                  throws ParseException,
                         java.io.IOException
Receive notification of the end of a JSON object.

返回:
false if the handler wants to stop parsing after return.
抛出:
ParseException
java.io.IOException
另请参见:
startObject()

startObjectEntry

boolean startObjectEntry(java.lang.String key)
                         throws ParseException,
                                java.io.IOException
Receive notification of the beginning of a JSON object entry.

参数:
key - - Key of a JSON object entry.
返回:
false if the handler wants to stop parsing after return.
抛出:
ParseException
java.io.IOException
另请参见:
endObjectEntry()

endObjectEntry

boolean endObjectEntry()
                       throws ParseException,
                              java.io.IOException
Receive notification of the end of the value of previous object entry.

返回:
false if the handler wants to stop parsing after return.
抛出:
ParseException
java.io.IOException
另请参见:
startObjectEntry(java.lang.String)

startArray

boolean startArray()
                   throws ParseException,
                          java.io.IOException
Receive notification of the beginning of a JSON array.

返回:
false if the handler wants to stop parsing after return.
抛出:
ParseException
java.io.IOException
另请参见:
endArray()

endArray

boolean endArray()
                 throws ParseException,
                        java.io.IOException
Receive notification of the end of a JSON array.

返回:
false if the handler wants to stop parsing after return.
抛出:
ParseException
java.io.IOException
另请参见:
startArray()

primitive

boolean primitive(java.lang.Object value)
                  throws ParseException,
                         java.io.IOException
Receive notification of the JSON primitive values: java.lang.String, java.lang.Number, java.lang.Boolean null

参数:
value - - Instance of the following: java.lang.String, java.lang.Number, java.lang.Boolean null
返回:
false if the handler wants to stop parsing after return.
抛出:
ParseException
java.io.IOException


Copyright © 2012. All Rights Reserved.