@Beta public class MockJsonParser extends JsonParser
| 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.
|
java.math.BigInteger |
getBigIntegerValue()
Returns the
BigInteger value of the current token. |
byte |
getByteValue()
Returns the byte value of the current token.
|
java.lang.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). |
java.math.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.
|
java.lang.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 JsonFactory getFactory()
JsonParsergetFactory in class JsonParserpublic void close()
throws java.io.IOException
JsonParserclose in class JsonParserjava.io.IOExceptionpublic JsonToken nextToken() throws java.io.IOException
JsonParsernull to indicate end of input.nextToken in class JsonParserjava.io.IOExceptionpublic JsonToken getCurrentToken()
JsonParsernull for none (at start of input or
after end of input).getCurrentToken in class JsonParserpublic java.lang.String getCurrentName()
throws java.io.IOException
JsonParsernull for array values or for root-level values.getCurrentName in class JsonParserjava.io.IOExceptionpublic JsonParser skipChildren() throws java.io.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 JsonParserjava.io.IOExceptionpublic java.lang.String getText()
throws java.io.IOException
JsonParsernull if
JsonParser.getCurrentToken() is null.getText in class JsonParserjava.io.IOExceptionpublic byte getByteValue()
throws java.io.IOException
JsonParsergetByteValue in class JsonParserjava.io.IOExceptionpublic short getShortValue()
throws java.io.IOException
JsonParsergetShortValue in class JsonParserjava.io.IOExceptionpublic int getIntValue()
throws java.io.IOException
JsonParsergetIntValue in class JsonParserjava.io.IOExceptionpublic float getFloatValue()
throws java.io.IOException
JsonParsergetFloatValue in class JsonParserjava.io.IOExceptionpublic long getLongValue()
throws java.io.IOException
JsonParsergetLongValue in class JsonParserjava.io.IOExceptionpublic double getDoubleValue()
throws java.io.IOException
JsonParsergetDoubleValue in class JsonParserjava.io.IOExceptionpublic java.math.BigInteger getBigIntegerValue()
throws java.io.IOException
JsonParserBigInteger value of the current token.getBigIntegerValue in class JsonParserjava.io.IOExceptionpublic java.math.BigDecimal getDecimalValue()
throws java.io.IOException
JsonParserBigDecimal value of the current token.getDecimalValue in class JsonParserjava.io.IOExceptionpublic boolean isClosed()
close() was called.Copyright © 2011-2018 Google. All Rights Reserved.