java.lang.Object
org.jooq.tools.json.JSONParser
Parser for JSON text. Please note that JSONParser is NOT thread-safe.
- Author:
- FangYidong<fangyidong@yahoo.com.cn>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintparse(Reader in, ContainerFactory containerFactory) Parse JSON text into java object from the input source.voidparse(Reader in, ContentHandler contentHandler) voidparse(Reader in, ContentHandler contentHandler, boolean isResume) Stream processing of JSON text.parse(String s, ContainerFactory containerFactory) voidparse(String s, ContentHandler contentHandler) voidparse(String s, ContentHandler contentHandler, boolean isResume) voidreset()Reset the parser to the initial state without resetting the underlying reader.voidReset the parser to the initial state with a new character reader.
- 
Field Details- 
S_INITpublic static final int S_INIT- See Also:
 
- 
S_IN_FINISHED_VALUEpublic static final int S_IN_FINISHED_VALUE- See Also:
 
- 
S_IN_OBJECTpublic static final int S_IN_OBJECT- See Also:
 
- 
S_IN_ARRAYpublic static final int S_IN_ARRAY- See Also:
 
- 
S_PASSED_PAIR_KEYpublic static final int S_PASSED_PAIR_KEY- See Also:
 
- 
S_IN_PAIR_VALUEpublic static final int S_IN_PAIR_VALUE- See Also:
 
- 
S_ENDpublic static final int S_END- See Also:
 
- 
S_IN_ERRORpublic static final int S_IN_ERROR- See Also:
 
 
- 
- 
Constructor Details- 
JSONParserpublic JSONParser()
 
- 
- 
Method Details- 
resetpublic void reset()Reset the parser to the initial state without resetting the underlying reader.
- 
resetReset the parser to the initial state with a new character reader.- Parameters:
- in- - The new character reader.
- Throws:
- IOException
- ParseException
 
- 
getPositionpublic int getPosition()- Returns:
- The position of the beginning of the current token.
 
- 
parse- Throws:
- ParseException
 
- 
parse- Throws:
- ParseException
 
- 
parse- Throws:
- IOException
- ParseException
 
- 
parsepublic Object parse(Reader in, ContainerFactory containerFactory) throws IOException, ParseException Parse JSON text into java object from the input source.- Parameters:
- in-
- containerFactory- - Use this factory to createyour own JSON object and JSON array containers.
- Returns:
- Instance of the following: org.json.simple.JSONObject, org.json.simple.JSONArray, java.lang.String, java.lang.Number, java.lang.Boolean, null
- Throws:
- IOException
- ParseException
 
- 
parse- Throws:
- ParseException
 
- 
parse- Throws:
- ParseException
 
- 
parse- Throws:
- IOException
- ParseException
 
- 
parsepublic void parse(Reader in, ContentHandler contentHandler, boolean isResume) throws IOException, ParseException Stream processing of JSON text.- Parameters:
- in-
- contentHandler-
- isResume- - Indicates if it continues previous parsing operation. If set to true, resume parsing the old stream, and parameter 'in' will be ignored. If this method is called for the first time in this instance, isResume will be ignored.
- Throws:
- IOException
- ParseException
- See Also:
 
 
-