|
JSON Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jackson.JsonParser
public abstract class JsonParser
This is the public API implemented by concrete JSON parser instances.
Nested Class Summary | |
---|---|
static class |
JsonParser.NumberType
Enumeration of possible "native" (optimal) types that can be used for numbers. |
Constructor Summary | |
---|---|
protected |
JsonParser()
|
Method Summary | |
---|---|
abstract void |
close()
|
abstract JsonLocation |
getCurrentLocation()
Method that returns location of the last processed character; usually for error reporting purposes. |
abstract String |
getCurrentName()
Method that can be called to get the name associated with the current event. |
abstract JsonToken |
getCurrentToken()
|
abstract BigDecimal |
getDecimalValue()
|
abstract double |
getDoubleValue()
|
abstract int |
getIntValue()
Numeric accessor that can be called when the current token is of type JsonToken.VALUE_NUMBER_INT and
it can be expressed as a Java int primitive type. |
abstract long |
getLongValue()
Numeric accessor that can be called when the current token is of type JsonToken.VALUE_NUMBER_INT and
it can be expressed as a Java long primitive type. |
abstract JsonParser.NumberType |
getNumberType()
If current event is of type JsonToken.VALUE_NUMBER_INT or
JsonToken.VALUE_NUMBER_FLOAT , returns
one of type constants; otherwise returns null. |
abstract Number |
getNumberValue()
Generic number value accessor method that will work for all kinds of numeric values. |
abstract JsonReadContext |
getParsingContext()
Method that can be used to access current parsing context reader is in. |
abstract String |
getText()
Method for accessing textual representation of the current event; if no current event (before first call to nextToken() , or
after encountering end-of-input), returns null. |
abstract char[] |
getTextCharacters()
|
abstract int |
getTextLength()
|
abstract int |
getTextOffset()
|
abstract JsonLocation |
getTokenLocation()
Method that return the starting location of the current token; that is, position of the first character from input that starts the current token. |
abstract boolean |
hasCurrentToken()
|
abstract JsonToken |
nextToken()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected JsonParser()
Method Detail |
---|
public abstract JsonToken nextToken() throws IOException, JsonParseException
IOException
JsonParseException
public abstract JsonToken getCurrentToken()
public abstract boolean hasCurrentToken()
public abstract String getCurrentName() throws IOException, JsonParseException
JsonToken.FIELD_NAME
.
IOException
JsonParseException
public abstract void close() throws IOException
IOException
public abstract JsonReadContext getParsingContext()
public abstract JsonLocation getTokenLocation()
public abstract JsonLocation getCurrentLocation()
public abstract String getText() throws IOException, JsonParseException
nextToken()
, or
after encountering end-of-input), returns null.
Method can be called for any event.
IOException
JsonParseException
public abstract char[] getTextCharacters() throws IOException, JsonParseException
IOException
JsonParseException
public abstract int getTextLength() throws IOException, JsonParseException
IOException
JsonParseException
public abstract int getTextOffset() throws IOException, JsonParseException
IOException
JsonParseException
public abstract Number getNumberValue() throws IOException, JsonParseException
IOException
JsonParseException
public abstract JsonParser.NumberType getNumberType() throws IOException, JsonParseException
JsonToken.VALUE_NUMBER_INT
or
JsonToken.VALUE_NUMBER_FLOAT
, returns
one of type constants; otherwise returns null.
IOException
JsonParseException
public abstract int getIntValue() throws IOException, JsonParseException
JsonToken.VALUE_NUMBER_INT
and
it can be expressed as a Java int primitive type.
Note: if the token is an integer, but its value falls
outside of range of Java int, a JsonParseException
will be thrown to indicate numeric overflow/underflow.
IOException
JsonParseException
public abstract long getLongValue() throws IOException, JsonParseException
JsonToken.VALUE_NUMBER_INT
and
it can be expressed as a Java long primitive type.
Note: if the token is an integer, but its value falls
outside of range of Java long, a JsonParseException
will be thrown to indicate numeric overflow/underflow.
IOException
JsonParseException
public abstract double getDoubleValue() throws IOException, JsonParseException
IOException
JsonParseException
public abstract BigDecimal getDecimalValue() throws IOException, JsonParseException
IOException
JsonParseException
|
JSON Version 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |