Class JacksonParser
java.lang.Object
com.google.api.client.json.JsonParser
com.google.api.client.json.jackson2.JacksonParser
- All Implemented Interfaces:
Closeable, AutoCloseable
Low-level JSON serializer implementation based on Jackson.
Implementation is not thread-safe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JsonFactoryprivate final com.fasterxml.jackson.core.JsonParser -
Constructor Summary
ConstructorsConstructorDescriptionJacksonParser(JsonFactory factory, com.fasterxml.jackson.core.JsonParser parser) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the parser and the underlying input stream or reader, and releases any memory associated with it.private static JsonTokenconvert(com.fasterxml.jackson.core.JsonToken token) Returns theBigIntegervalue of the current token.byteReturns the byte value of the current token.Returns the most recent field name ornullfor array values or for root-level values.Returns the token the parser currently points to ornullfor none (at start of input or after end of input).Returns theBigDecimalvalue of the current token.doubleReturns the double value of the current token.Returns the JSON factory from which this generator was created.floatReturns the float value of the current token.intReturns the int value of the current token.longReturns the long value of the current token.shortReturns the short value of the current token.getText()Returns a textual representation of the current token ornullifJsonParser.getCurrentToken()isnull.Returns the next token from the stream ornullto indicate end of input.Skips to the matchingJsonToken.END_ARRAYif current token isJsonToken.START_ARRAY, the matchingJsonToken.END_OBJECTif the current token isJsonToken.START_OBJECT, else does nothing.Methods inherited from class JsonParser
parse, parse, parse, parse, parse, parse, parseAndClose, parseAndClose, parseAndClose, parseAndClose, parseArray, parseArray, parseArray, parseArray, parseArrayAndClose, parseArrayAndClose, parseArrayAndClose, parseArrayAndClose, skipToKey, skipToKey
-
Field Details
-
parser
private final com.fasterxml.jackson.core.JsonParser parser -
factory
-
-
Constructor Details
-
JacksonParser
JacksonParser(JsonFactory factory, com.fasterxml.jackson.core.JsonParser parser)
-
-
Method Details
-
getFactory
Description copied from class:JsonParserReturns the JSON factory from which this generator was created.- Specified by:
getFactoryin classJsonParser
-
close
Description copied from class:JsonParserCloses the parser and the underlying input stream or reader, and releases any memory associated with it.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classJsonParser- Throws:
IOException
-
nextToken
Description copied from class:JsonParserReturns the next token from the stream ornullto indicate end of input.- Specified by:
nextTokenin classJsonParser- Throws:
IOException
-
getCurrentName
Description copied from class:JsonParserReturns the most recent field name ornullfor array values or for root-level values.- Specified by:
getCurrentNamein classJsonParser- Throws:
IOException
-
getCurrentToken
Description copied from class:JsonParserReturns the token the parser currently points to ornullfor none (at start of input or after end of input).- Specified by:
getCurrentTokenin classJsonParser
-
skipChildren
Description copied from class:JsonParserSkips to the matchingJsonToken.END_ARRAYif current token isJsonToken.START_ARRAY, the matchingJsonToken.END_OBJECTif the current token isJsonToken.START_OBJECT, else does nothing.- Specified by:
skipChildrenin classJsonParser- Throws:
IOException
-
getText
Description copied from class:JsonParserReturns a textual representation of the current token ornullifJsonParser.getCurrentToken()isnull.- Specified by:
getTextin classJsonParser- Throws:
IOException
-
getByteValue
Description copied from class:JsonParserReturns the byte value of the current token.- Specified by:
getByteValuein classJsonParser- Throws:
IOException
-
getFloatValue
Description copied from class:JsonParserReturns the float value of the current token.- Specified by:
getFloatValuein classJsonParser- Throws:
IOException
-
getIntValue
Description copied from class:JsonParserReturns the int value of the current token.- Specified by:
getIntValuein classJsonParser- Throws:
IOException
-
getShortValue
Description copied from class:JsonParserReturns the short value of the current token.- Specified by:
getShortValuein classJsonParser- Throws:
IOException
-
getBigIntegerValue
Description copied from class:JsonParserReturns theBigIntegervalue of the current token.- Specified by:
getBigIntegerValuein classJsonParser- Throws:
IOException
-
getDecimalValue
Description copied from class:JsonParserReturns theBigDecimalvalue of the current token.- Specified by:
getDecimalValuein classJsonParser- Throws:
IOException
-
getDoubleValue
Description copied from class:JsonParserReturns the double value of the current token.- Specified by:
getDoubleValuein classJsonParser- Throws:
IOException
-
getLongValue
Description copied from class:JsonParserReturns the long value of the current token.- Specified by:
getLongValuein classJsonParser- Throws:
IOException
-
convert
-