@Beta public class MockJsonParser extends JsonParser
| Constructor and Description |
|---|
MockJsonParser(JsonFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the parser and the underlying input stream or reader, and releases any memory associated
with it.
|
BigInteger |
getBigIntegerValue()
Returns the
BigInteger value of the current token. |
byte |
getByteValue()
Returns the byte value of the current token.
|
String |
getCurrentName()
Returns the most recent field name or
null for array values or for root-level values. |
JsonToken |
getCurrentToken()
Returns the token the parser currently points to or
null for none (at start of input or
after end of input). |
BigDecimal |
getDecimalValue()
Returns the
BigDecimal value of the current token. |
double |
getDoubleValue()
Returns the double value of the current token.
|
JsonFactory |
getFactory()
Returns the JSON factory from which this generator was created.
|
float |
getFloatValue()
Returns the float value of the current token.
|
int |
getIntValue()
Returns the int value of the current token.
|
long |
getLongValue()
Returns the long value of the current token.
|
short |
getShortValue()
Returns the short value of the current token.
|
String |
getText()
Returns a textual representation of the current token or
null if JsonParser.getCurrentToken() is null. |
boolean |
isClosed()
Returns whether
close() was called. |
JsonToken |
nextToken()
Returns the next token from the stream or
null to indicate end of input. |
JsonParser |
skipChildren()
Skips to the matching
JsonToken.END_ARRAY if current token is JsonToken.START_ARRAY, the matching JsonToken.END_OBJECT if the current token is
JsonToken.START_OBJECT, else does nothing. |
parse, parse, parse, parse, parse, parse, parseAndClose, parseAndClose, parseAndClose, parseAndClose, parseArray, parseArray, parseArray, parseArray, parseArrayAndClose, parseArrayAndClose, parseArrayAndClose, parseArrayAndClose, skipToKey, skipToKeypublic MockJsonParser(JsonFactory factory)
public JsonFactory getFactory()
JsonParsergetFactory in class JsonParserpublic void close()
throws IOException
JsonParserclose in interface Closeableclose in interface AutoCloseableclose in class JsonParserIOExceptionpublic JsonToken nextToken() throws IOException
JsonParsernull to indicate end of input.nextToken in class JsonParserIOExceptionpublic JsonToken getCurrentToken()
JsonParsernull for none (at start of input or
after end of input).getCurrentToken in class JsonParserpublic String getCurrentName() throws IOException
JsonParsernull for array values or for root-level values.getCurrentName in class JsonParserIOExceptionpublic JsonParser skipChildren() throws IOException
JsonParserJsonToken.END_ARRAY if current token is JsonToken.START_ARRAY, the matching JsonToken.END_OBJECT if the current token is
JsonToken.START_OBJECT, else does nothing.skipChildren in class JsonParserIOExceptionpublic String getText() throws IOException
JsonParsernull if JsonParser.getCurrentToken() is null.getText in class JsonParserIOExceptionpublic byte getByteValue()
throws IOException
JsonParsergetByteValue in class JsonParserIOExceptionpublic short getShortValue()
throws IOException
JsonParsergetShortValue in class JsonParserIOExceptionpublic int getIntValue()
throws IOException
JsonParsergetIntValue in class JsonParserIOExceptionpublic float getFloatValue()
throws IOException
JsonParsergetFloatValue in class JsonParserIOExceptionpublic long getLongValue()
throws IOException
JsonParsergetLongValue in class JsonParserIOExceptionpublic double getDoubleValue()
throws IOException
JsonParsergetDoubleValue in class JsonParserIOExceptionpublic BigInteger getBigIntegerValue() throws IOException
JsonParserBigInteger value of the current token.getBigIntegerValue in class JsonParserIOExceptionpublic BigDecimal getDecimalValue() throws IOException
JsonParserBigDecimal value of the current token.getDecimalValue in class JsonParserIOExceptionpublic boolean isClosed()
close() was called.Copyright © 2011–2025 Google. All rights reserved.