Class MockJsonParser
java.lang.Object
com.google.api.client.json.JsonParser
com.google.api.client.testing.json.MockJsonParser
- All Implemented Interfaces:
Closeable, AutoCloseable
- Since:
- 1.15 (since 1.11 as com.google.api.client.testing.http.json.MockJsonParser)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the parser and the underlying input stream or reader, and releases any memory associated with it.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.booleanisClosed()Returns whetherclose()was called.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
-
isClosed
private boolean isClosed -
factory
-
-
Constructor Details
-
MockJsonParser
-
-
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
-
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
-
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
-
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
-
getShortValue
Description copied from class:JsonParserReturns the short value of the current token.- Specified by:
getShortValuein classJsonParser- Throws:
IOException
-
getIntValue
Description copied from class:JsonParserReturns the int value of the current token.- Specified by:
getIntValuein classJsonParser- Throws:
IOException
-
getFloatValue
Description copied from class:JsonParserReturns the float value of the current token.- Specified by:
getFloatValuein classJsonParser- Throws:
IOException
-
getLongValue
Description copied from class:JsonParserReturns the long value of the current token.- Specified by:
getLongValuein classJsonParser- Throws:
IOException
-
getDoubleValue
Description copied from class:JsonParserReturns the double value of the current token.- Specified by:
getDoubleValuein 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
-
isClosed
-