|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.api.client.json.JsonParser
com.google.api.client.testing.http.json.MockJsonParser
public class MockJsonParser
Mock for JsonParser.
Implementation is thread-safe.
| Method Summary | |
|---|---|
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. |
com.google.common.primitives.UnsignedInteger |
getUnsignedIntegerValue()
Returns the UnsignedInteger value of the current token. |
com.google.common.primitives.UnsignedLong |
getUnsignedLongValue()
Returns the UnsignedLong value of the current token. |
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. |
| Methods inherited from class com.google.api.client.json.JsonParser |
|---|
parse, parse, parse, parseAndClose, parseAndClose, parseArray, parseArray, parseArrayAndClose, parseArrayAndClose, skipToKey, skipToKey |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public JsonFactory getFactory()
JsonParser
getFactory in class JsonParser
public void close()
throws IOException
JsonParser
close in class JsonParserIOException - if failed
public 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 JsonParser
public String getCurrentName()
throws IOException
JsonParsernull for array values or for root-level values.
getCurrentName in class JsonParserIOException
public 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 JsonParserIOException
public String getText()
throws IOException
JsonParsernull if
JsonParser.getCurrentToken() is null.
getText in class JsonParserIOException
public byte getByteValue()
throws IOException
JsonParser
getByteValue in class JsonParserIOException
public short getShortValue()
throws IOException
JsonParser
getShortValue in class JsonParserIOException
public int getIntValue()
throws IOException
JsonParser
getIntValue in class JsonParserIOException
public float getFloatValue()
throws IOException
JsonParser
getFloatValue in class JsonParserIOException
public long getLongValue()
throws IOException
JsonParser
getLongValue in class JsonParserIOException
public double getDoubleValue()
throws IOException
JsonParser
getDoubleValue in class JsonParserIOException
public BigInteger getBigIntegerValue()
throws IOException
JsonParserBigInteger value of the current token.
getBigIntegerValue in class JsonParserIOException
public com.google.common.primitives.UnsignedInteger getUnsignedIntegerValue()
throws IOException
JsonParserUnsignedInteger value of the current token.
getUnsignedIntegerValue in class JsonParserIOException
public com.google.common.primitives.UnsignedLong getUnsignedLongValue()
throws IOException
JsonParserUnsignedLong value of the current token.
getUnsignedLongValue in class JsonParserIOException
public BigDecimal getDecimalValue()
throws IOException
JsonParserBigDecimal value of the current token.
getDecimalValue in class JsonParserIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||