Package org.apache.tomcat.util.json
Class JSONParser
java.lang.Object
org.apache.tomcat.util.json.JSONParser
- All Implemented Interfaces:
- JSONParserConstants
Basic JSON parser generated by JavaCC. It consumes the input provided through the constructor when
 
parseObject(), parseList(), or parse() are called, and there is no way to directly
 reset the state.- 
Field SummaryFieldsModifier and TypeFieldDescriptionNext token.Current token.Generated Token Manager.Fields inherited from interface org.apache.tomcat.util.json.JSONParserConstantsBRACE_CLOSE, BRACE_OPEN, BRACKET_CLOSE, BRACKET_OPEN, C_MULTILINE_COMMENT, C_SINGLE_COMMENT, COLON, COMMA, DEFAULT, DIGIT, DIGIT_NONZERO, EOF, EOL, FALSE, NULL, NUMBER_DECIMAL, NUMBER_INTEGER, QUOTE_DOUBLE, QUOTE_SINGLE, SH_SINGLE_COMMENT, STRING_DOUBLE_BODY, STRING_DOUBLE_EMPTY, STRING_DOUBLE_NONEMPTY, STRING_SINGLE_BODY, STRING_SINGLE_EMPTY, STRING_SINGLE_NONEMPTY, SYMBOL, tokenImage, TRUE, WHITESPACE, ZERO
- 
Constructor SummaryConstructorsConstructorDescriptionJSONParser(InputStream stream) Constructor with InputStream.JSONParser(InputStream stream, String encoding) Constructor with InputStream and supplied encodingJSONParser(Reader stream) Constructor.JSONParser(String input) Constructor with generated Token Manager.
- 
Method SummaryModifier and TypeMethodDescriptionfinal Objectanything()final Booleanfinal voidDisable tracing.final Stringfinal voidEnable tracing.final booleanGenerate ParseException.booleanfinal TokenGet the next Token.final TokengetToken(int index) Get the specific Token.list()final Objectfinal Numbernumber()final LinkedHashMap<String,Object> object()final Stringparse()Parses any JSON-parseable object, returning the value.Parses a JSON array into a JavaList.Parses a JSON object into a JavaMap.voidReInit(InputStream stream) Reinitialise.voidReInit(InputStream stream, String encoding) Reinitialise.voidReinitialise.voidReinitialise.voidsetNativeNumbers(boolean value) final Stringfinal Stringstring()final Stringsymbol()final booleanTrace enabled.final Objectvalue()
- 
Field Details- 
token_sourceGenerated Token Manager.
- 
tokenCurrent token.
- 
jj_ntNext token.
 
- 
- 
Constructor Details- 
JSONParser
- 
JSONParserConstructor with InputStream.
- 
JSONParserConstructor with InputStream and supplied encoding
- 
JSONParserConstructor.
- 
JSONParserConstructor with generated Token Manager.
 
- 
- 
Method Details- 
parseObjectParses a JSON object into a JavaMap.- Throws:
- ParseException
 
- 
parseArrayParses a JSON array into a JavaList.- Throws:
- ParseException
 
- 
parseParses any JSON-parseable object, returning the value.- Throws:
- ParseException
 
- 
setNativeNumberspublic void setNativeNumbers(boolean value) 
- 
getNativeNumberspublic boolean getNativeNumbers()
- 
ensureEOF- Throws:
- ParseException
 
- 
anything- Throws:
- ParseException
 
- 
objectKey- Throws:
- ParseException
 
- 
object- Throws:
- ParseException
 
- 
list- Throws:
- ParseException
 
- 
value- Throws:
- ParseException
 
- 
nullValue- Throws:
- ParseException
 
- 
booleanValue- Throws:
- ParseException
 
- 
number- Throws:
- ParseException
 
- 
string- Throws:
- ParseException
 
- 
doubleQuoteString- Throws:
- ParseException
 
- 
singleQuoteString- Throws:
- ParseException
 
- 
symbol- Throws:
- ParseException
 
- 
ReInitReinitialise.
- 
ReInitReinitialise.
- 
ReInitReinitialise.
- 
ReInitReinitialise.
- 
getNextTokenGet the next Token.
- 
getTokenGet the specific Token.
- 
generateParseExceptionGenerate ParseException.
- 
trace_enabledpublic final boolean trace_enabled()Trace enabled.
- 
enable_tracingpublic final void enable_tracing()Enable tracing.
- 
disable_tracingpublic final void disable_tracing()Disable tracing.
 
-