public class MockJsonParser extends JsonParser
Constructors
MockJsonParser(JsonFactory factory)
public MockJsonParser(JsonFactory factory)
Parameter | |
---|---|
Name | Description |
factory | JsonFactory |
Methods
close()
public void close()
Closes the parser and the underlying input stream or reader, and releases any memory associated with it.
Exceptions | |
---|---|
Type | Description |
IOException |
getBigIntegerValue()
public BigInteger getBigIntegerValue()
Returns the BigInteger value of the current token.
Returns | |
---|---|
Type | Description |
BigInteger |
Exceptions | |
---|---|
Type | Description |
IOException |
getByteValue()
public byte getByteValue()
Returns the byte value of the current token.
Returns | |
---|---|
Type | Description |
byte |
Exceptions | |
---|---|
Type | Description |
IOException |
getCurrentName()
public String getCurrentName()
Returns the most recent field name or null
for array values or for root-level values.
Returns | |
---|---|
Type | Description |
String |
Exceptions | |
---|---|
Type | Description |
IOException |
getCurrentToken()
public JsonToken getCurrentToken()
Returns the token the parser currently points to or null
for none (at start of input or
after end of input).
Returns | |
---|---|
Type | Description |
JsonToken |
getDecimalValue()
public BigDecimal getDecimalValue()
Returns the BigDecimal value of the current token.
Returns | |
---|---|
Type | Description |
BigDecimal |
Exceptions | |
---|---|
Type | Description |
IOException |
getDoubleValue()
public double getDoubleValue()
Returns the double value of the current token.
Returns | |
---|---|
Type | Description |
double |
Exceptions | |
---|---|
Type | Description |
IOException |
getFactory()
public JsonFactory getFactory()
Returns the JSON factory from which this generator was created.
Returns | |
---|---|
Type | Description |
JsonFactory |
getFloatValue()
public float getFloatValue()
Returns the float value of the current token.
Returns | |
---|---|
Type | Description |
float |
Exceptions | |
---|---|
Type | Description |
IOException |
getIntValue()
public int getIntValue()
Returns the int value of the current token.
Returns | |
---|---|
Type | Description |
int |
Exceptions | |
---|---|
Type | Description |
IOException |
getLongValue()
public long getLongValue()
Returns the long value of the current token.
Returns | |
---|---|
Type | Description |
long |
Exceptions | |
---|---|
Type | Description |
IOException |
getShortValue()
public short getShortValue()
Returns the short value of the current token.
Returns | |
---|---|
Type | Description |
short |
Exceptions | |
---|---|
Type | Description |
IOException |
getText()
public String getText()
Returns a textual representation of the current token or null
if #getCurrentToken() is null
.
Returns | |
---|---|
Type | Description |
String |
Exceptions | |
---|---|
Type | Description |
IOException |
isClosed()
public boolean isClosed()
Returns whether #close() was called.
Returns | |
---|---|
Type | Description |
boolean |
nextToken()
public JsonToken nextToken()
Returns the next token from the stream or null
to indicate end of input.
Returns | |
---|---|
Type | Description |
JsonToken |
Exceptions | |
---|---|
Type | Description |
IOException |
skipChildren()
public 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.
Returns | |
---|---|
Type | Description |
JsonParser |
Exceptions | |
---|---|
Type | Description |
IOException |