Example usage for Java com.fasterxml.jackson.core JsonParser fields, constructors, methods, implement or subclass
The text is from its open source code.
void | clearCurrentToken() Method called to "consume" the current token by effectively removing it so that #hasCurrentToken returns false, and #getCurrentToken null). |
void | close() Closes the parser so that no further iteration or data access can be made; will also close the underlying input source if parser either owns the input source, or feature Feature#AUTO_CLOSE_SOURCE is enabled. |
JsonParser | configure(Feature f, boolean state) Method for enabling or disabling specified feature (check Feature for list of features) |
JsonParser | disable(Feature f) Method for disabling specified feature (check Feature for list of features) |
JsonParser | enable(Feature f) Method for enabling specified parser feature (check Feature for list of features) |
BigInteger | getBigIntegerValue() Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it can not be used as a Java long primitive type due to its magnitude. |
byte[] | getBinaryValue() Convenience alternative to #getBinaryValue(Base64Variant) that defaults to using Base64Variants#getDefaultVariant as the default encoding. |
boolean | getBooleanValue() Convenience accessor that can be called when the current token is JsonToken#VALUE_TRUE or JsonToken#VALUE_FALSE . |
byte | getByteValue() Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it can be expressed as a value of Java byte primitive type. |
Class> | getClass() Returns the runtime class of this Object . |
ObjectCodec | getCodec() Accessor for ObjectCodec associated with this parser, if any. |
JsonLocation | getCurrentLocation() Method that returns location of the last processed character; usually for error reporting purposes. |
String | getCurrentName() Method that can be called to get the name associated with the current token: for JsonToken#FIELD_NAME s it will be the same as what #getText returns; for field values it will be preceding field name; and for others (array values, root-level values) null. |
JsonToken | getCurrentToken() Accessor to find which token parser currently points to, if any; null will be returned if none. |
BigDecimal | getDecimalValue() Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_FLOAT or JsonToken#VALUE_NUMBER_INT . |
double | getDoubleValue() Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_FLOAT and it can be expressed as a Java double primitive type. |
Object | getEmbeddedObject() Accessor that can be called if (and only if) the current token is JsonToken#VALUE_EMBEDDED_OBJECT . |
float | getFloatValue() Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_FLOAT and it can be expressed as a Java float primitive type. |
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 value of Java int primitive type. |
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. |
NumberType | getNumberType() If current token is of type JsonToken#VALUE_NUMBER_INT or JsonToken#VALUE_NUMBER_FLOAT , returns one of NumberType constants; otherwise returns null. |
Number | getNumberValue() Generic number value accessor method that will work for all kinds of numeric values. |
JsonStreamContext | getParsingContext() Method that can be used to access current parsing context reader is in. |
short | getShortValue() Numeric accessor that can be called when the current token is of type JsonToken#VALUE_NUMBER_INT and it can be expressed as a value of Java short primitive type. |
String | getText() Method for accessing textual representation of the current token; if no current token (before first call to #nextToken , or after encountering end-of-input), returns null. |
char[] | getTextCharacters() Method similar to #getText , but that will return underlying (unmodifiable) character array that contains textual value, instead of constructing a String object to contain this information. |
int | getTextLength() Accessor used with #getTextCharacters , to know length of String stored in returned buffer. |
int | getTextOffset() Accessor used with #getTextCharacters , to know offset of the first text content character within buffer. |
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. |
boolean | getValueAsBoolean() Method that will try to convert value of current token to a boolean. |
double | getValueAsDouble() Method that will try to convert value of current token to a Java double. |
double | getValueAsDouble(double defaultValue) Method that will try to convert value of current token to a Java double. |
int | getValueAsInt() Method that will try to convert value of current token to a int. |
int | getValueAsInt(int defaultValue) Method that will try to convert value of current token to a int. |
long | getValueAsLong() Method that will try to convert value of current token to a long. |
String | getValueAsString() Method that will try to convert value of current token to a java.lang.String . |
boolean | hasCurrentToken() Method for checking whether parser currently points to a token (and data for that token is available). |
boolean | hasTextCharacters() Method that can be used to determine whether calling of #getTextCharacters would be the most efficient way to access textual content for the event parser currently points to. |
boolean | isClosed() Method that can be called to determine whether this parser is closed or not. |
boolean | isExpectedStartArrayToken() Specialized accessor that can be used to verify that the current token indicates start array (usually meaning that current token is JsonToken#START_ARRAY ) when start array is expected. |
Boolean | nextBooleanValue() Method that fetches next token (as if calling #nextToken ) and if it is JsonToken#VALUE_TRUE or JsonToken#VALUE_FALSE returns matching Boolean value; otherwise return null. |
int | nextIntValue(int defaultValue) Method that fetches next token (as if calling #nextToken ) and if it is JsonToken#VALUE_NUMBER_INT returns 32-bit int value; otherwise returns specified default value It is functionally equivalent to: return (nextToken() == JsonToken.VALUE_NUMBER_INT) ? |
long | nextLongValue(long defaultValue) Method that fetches next token (as if calling #nextToken ) and if it is JsonToken#VALUE_NUMBER_INT returns 64-bit long value; otherwise returns specified default value It is functionally equivalent to: return (nextToken() == JsonToken.VALUE_NUMBER_INT) ? |
String | nextTextValue() Method that fetches next token (as if calling #nextToken ) and if it is JsonToken#VALUE_STRING returns contained String value; otherwise returns null. |
JsonToken | nextToken() Main iteration method, which will advance stream enough to determine type of the next token, if any. |
JsonToken | nextValue() Iteration method that will advance stream enough to determine type of the next token that is a value type (including JSON Array and Object start/end markers). |
T | readValueAs(Class Method to deserialize JSON content into a non-container type (it can be an array type, however): typically a bean, array or a wrapper type (like java.lang.Boolean ). |
T | readValueAs(TypeReference> valueTypeRef) Method to deserialize JSON content into a Java type, reference to which is passed as argument. |
T | readValueAsTree() Method to deserialize JSON content into equivalent "tree model", represented by root TreeNode of resulting model. |
Iterator | readValuesAs(Class Method for reading sequence of Objects from parser stream, all with same specified value type. |
Iterator | readValuesAs(TypeReference> valueTypeRef) Method for reading sequence of Objects from parser stream, all with same specified value type. |
void | setCodec(ObjectCodec c) Setter that allows defining ObjectCodec associated with this parser, if any. |
JsonParser | skipChildren() Method that will skip all child tokens of an array or object token that the parser currently points to, iff stream points to JsonToken#START_OBJECT or JsonToken#START_ARRAY . |
String | toString() Returns a string representation of the object. |