Package org.json.simple.parser
Class JSONParser
- java.lang.Object
-
- org.json.simple.parser.JSONParser
-
public class JSONParser extends java.lang.ObjectParser for JSON text. Please note that JSONParser is NOT thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description static intS_ENDdescription omitted.static intS_IN_ARRAYdescription omitted.static intS_IN_ERRORdescription omitted.static intS_IN_FINISHED_VALUEdescription omitted.static intS_IN_OBJECTdescription omitted.static intS_IN_PAIR_VALUEdescription omitted.static intS_INITdescription omitted.static intS_PASSED_PAIR_KEYdescription omitted.
-
Constructor Summary
Constructors Constructor Description JSONParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetPosition()java.lang.Objectparse(java.io.Reader in)description omitted.java.lang.Objectparse(java.io.Reader in, ContainerFactory containerFactory)Parse JSON text into java object from the input source.voidparse(java.io.Reader in, ContentHandler contentHandler)description omitted.voidparse(java.io.Reader in, ContentHandler contentHandler, boolean isResume)Stream processing of JSON text.java.lang.Objectparse(java.lang.String s)description omitted.java.lang.Objectparse(java.lang.String s, ContainerFactory containerFactory)description omitted.voidparse(java.lang.String s, ContentHandler contentHandler)description omitted.voidparse(java.lang.String s, ContentHandler contentHandler, boolean isResume)description omitted.voidreset()Reset the parser to the initial state without resetting the underlying reader.voidreset(java.io.Reader in)Reset the parser to the initial state with a new character reader.
-
-
-
Field Detail
-
S_INIT
public static final int S_INIT
description omitted.- See Also:
- Constant Field Values
-
S_IN_FINISHED_VALUE
public static final int S_IN_FINISHED_VALUE
description omitted.- See Also:
- Constant Field Values
-
S_IN_OBJECT
public static final int S_IN_OBJECT
description omitted.- See Also:
- Constant Field Values
-
S_IN_ARRAY
public static final int S_IN_ARRAY
description omitted.- See Also:
- Constant Field Values
-
S_PASSED_PAIR_KEY
public static final int S_PASSED_PAIR_KEY
description omitted.- See Also:
- Constant Field Values
-
S_IN_PAIR_VALUE
public static final int S_IN_PAIR_VALUE
description omitted.- See Also:
- Constant Field Values
-
S_END
public static final int S_END
description omitted.- See Also:
- Constant Field Values
-
S_IN_ERROR
public static final int S_IN_ERROR
description omitted.- See Also:
- Constant Field Values
-
-
Method Detail
-
reset
public void reset()
Reset the parser to the initial state without resetting the underlying reader.
-
reset
public void reset(java.io.Reader in)
Reset the parser to the initial state with a new character reader.- Parameters:
in- - The new character reader.
-
getPosition
public int getPosition()
- Returns:
- The position of the beginning of the current token.
-
parse
public java.lang.Object parse(java.lang.String s) throws ParseExceptiondescription omitted.- Parameters:
s- description omitted.- Returns:
- description omitted.
- Throws:
ParseException- description omitted.
-
parse
public java.lang.Object parse(java.lang.String s, ContainerFactory containerFactory) throws ParseExceptiondescription omitted.- Parameters:
s- description omitted.containerFactory- description omitted.- Returns:
- description omitted.
- Throws:
ParseException- description omitted.
-
parse
public java.lang.Object parse(java.io.Reader in) throws java.io.IOException, ParseExceptiondescription omitted.- Parameters:
in- description omitted.- Returns:
- description omitted.
- Throws:
java.io.IOException- description omitted.ParseException- description omitted.
-
parse
public java.lang.Object parse(java.io.Reader in, ContainerFactory containerFactory) throws java.io.IOException, ParseExceptionParse JSON text into java object from the input source.- Parameters:
in- description omitted.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:
java.io.IOException- description omitted.ParseException- description omitted.
-
parse
public void parse(java.lang.String s, ContentHandler contentHandler) throws ParseExceptiondescription omitted.- Parameters:
s- description omitted.contentHandler- description omitted.- Throws:
ParseException- description omitted.
-
parse
public void parse(java.lang.String s, ContentHandler contentHandler, boolean isResume) throws ParseExceptiondescription omitted.- Parameters:
s- description omitted.contentHandler- description omitted.isResume- description omitted.- Throws:
ParseException- description omitted.
-
parse
public void parse(java.io.Reader in, ContentHandler contentHandler) throws java.io.IOException, ParseExceptiondescription omitted.- Parameters:
in- description omitted.contentHandler- description omitted.- Throws:
java.io.IOException- description omitted.ParseException- description omitted.
-
parse
public void parse(java.io.Reader in, ContentHandler contentHandler, boolean isResume) throws java.io.IOException, ParseExceptionStream processing of JSON text.- Parameters:
in- description omitted.contentHandler- description omitted.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:
java.io.IOException- description omitted.ParseException- description omitted.- See Also:
ContentHandler
-
-