JsonParseException
|
_constructError(String msg)
|
void
|
_reportUnsupportedOperation()
Helper method to call for operations that are not supported by
parser implementation.
|
boolean
|
canUseSchema(FormatSchema schema)
|
abstract
void
|
clearCurrentToken()
|
abstract
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
AUTO_CLOSE_SOURCE is enabled.
|
JsonParser
|
configure(JsonParser.Feature f, boolean state)
Method for enabling or disabling specified feature
(check JsonParser.Feature for list of features)
|
JsonParser
|
disable(JsonParser.Feature f)
|
JsonParser
|
enable(JsonParser.Feature f)
Method for enabling specified parser feature
(check JsonParser.Feature for list of features)
|
abstract
BigInteger
|
getBigIntegerValue()
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_INT and
it can not be used as a Java long primitive type due to its
magnitude.
|
abstract
byte[]
|
getBinaryValue(Base64Variant b64variant)
Method that can be used to read (and consume -- results
may not be accessible using other methods after the call)
base64-encoded binary data
included in the current textual JSON value.
|
byte[]
|
getBinaryValue()
|
boolean
|
getBooleanValue()
|
byte
|
getByteValue()
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_INT and
it can be expressed as a value of Java byte primitive type.
|
abstract
ObjectCodec
|
getCodec()
Accessor for ObjectCodec associated with this
parser, if any.
|
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 token: for 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.
|
abstract
JsonToken
|
getCurrentToken()
Accessor to find which token parser currently points to, if any;
null will be returned if none.
|
abstract
BigDecimal
|
getDecimalValue()
|
abstract
double
|
getDoubleValue()
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_FLOAT and
it can be expressed as a Java double primitive type.
|
abstract
Object
|
getEmbeddedObject()
|
abstract
float
|
getFloatValue()
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_FLOAT and
it can be expressed as a Java float primitive type.
|
Object
|
getInputSource()
Method that can be used to get access to object that is used
to access input being parsed; this is usually either
InputStream or Reader, depending on what
parser was constructed with.
|
abstract
int
|
getIntValue()
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_INT and
it can be expressed as a value of Java int primitive type.
|
abstract
JsonToken
|
getLastClearedToken()
|
abstract
long
|
getLongValue()
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_INT and
it can be expressed as a Java long primitive type.
|
abstract
JsonParser.NumberType
|
getNumberType()
|
abstract
Number
|
getNumberValue()
Generic number value accessor method that will work for
all kinds of numeric values.
|
abstract
JsonStreamContext
|
getParsingContext()
Method that can be used to access current parsing context reader
is in.
|
FormatSchema
|
getSchema()
Method for accessing Schema that this parser uses, if any.
|
short
|
getShortValue()
Numeric accessor that can be called when the current
token is of type VALUE_NUMBER_INT and
it can be expressed as a value of Java short primitive type.
|
abstract
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.
|
abstract
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.
|
abstract
int
|
getTextLength()
|
abstract
int
|
getTextOffset()
Accessor used with getTextCharacters() , to know offset
of the first text content character within buffer.
|
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.
|
boolean
|
getValueAsBoolean(boolean defaultValue)
Method that will try to convert value of current token to a
boolean.
|
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(int defaultValue)
Method that will try to convert value of current token to a
int.
|
int
|
getValueAsInt()
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.
|
long
|
getValueAsLong(long defaultValue)
Method that will try to convert value of current token to a
long.
|
abstract
boolean
|
hasCurrentToken()
Method for checking whether parser currently points to
a token (and data for that token is available).
|
abstract
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.
|
abstract
boolean
|
isClosed()
Method that can be called to determine whether this parser
is closed or not.
|
boolean
|
isEnabled(JsonParser.Feature f)
|
boolean
|
isExpectedStartArrayToken()
Specialized accessor that can be used to verify that the current
token indicates start array (usually meaning that current token
is START_ARRAY ) when start array is expected.
|
Boolean
|
nextBooleanValue()
|
boolean
|
nextFieldName(SerializableString str)
Method that fetches next token (as if calling nextToken() ) and
verifies whether it is FIELD_NAME with specified name
and returns result of that comparison.
|
int
|
nextIntValue(int defaultValue)
Method that fetches next token (as if calling nextToken() ) and
if it is VALUE_NUMBER_INT returns 32-bit int value;
otherwise returns specified default value
It is functionally equivalent to:
return (nextToken() == JsonToken.VALUE_NUMBER_INT) ? getIntValue() : defaultValue;
but may be faster for parser to process, and can therefore be used if caller
expects to get a String value next from input.
|
long
|
nextLongValue(long defaultValue)
Method that fetches next token (as if calling nextToken() ) and
if it is VALUE_NUMBER_INT returns 64-bit long value;
otherwise returns specified default value
It is functionally equivalent to:
return (nextToken() == JsonToken.VALUE_NUMBER_INT) ? getLongValue() : defaultValue;
but may be faster for parser to process, and can therefore be used if caller
expects to get a String value next from input.
|
String
|
nextTextValue()
Method that fetches next token (as if calling nextToken() ) and
if it is VALUE_STRING returns contained String value;
otherwise returns null.
|
abstract
JsonToken
|
nextToken()
Main iteration method, which will advance stream enough
to determine type of the next token, if any.
|
abstract
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).
|
abstract
void
|
overrideCurrentName(String name)
Method that can be used to change what is considered to be
the current (field) name.
|
int
|
readBinaryValue(Base64Variant b64variant, OutputStream out)
|
int
|
readBinaryValue(OutputStream out)
Method that can be used as an alternative to getBigIntegerValue() ,
especially when value can be large.
|
<T>
T
|
readValueAs(TypeReference<?> valueTypeRef)
Method to deserialize JSON content into a Java type, reference
to which is passed as argument.
|
<T>
T
|
readValueAs(Class<T> valueType)
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 Boolean ).
|
<T extends TreeNode>
T
|
readValueAsTree()
Method to deserialize JSON content into equivalent "tree model",
represented by root TreeNode of resulting model.
|
<T>
Iterator<T>
|
readValuesAs(Class<T> valueType)
Method for reading sequence of Objects from parser stream,
all with same specified value type.
|
<T>
Iterator<T>
|
readValuesAs(TypeReference<?> valueTypeRef)
Method for reading sequence of Objects from parser stream,
all with same specified value type.
|
int
|
releaseBuffered(Writer w)
Method that can be called to push back any content that
has been read but not consumed by the parser.
|
int
|
releaseBuffered(OutputStream out)
Method that can be called to push back any content that
has been read but not consumed by the parser.
|
abstract
void
|
setCodec(ObjectCodec c)
Setter that allows defining ObjectCodec associated with this
parser, if any.
|
void
|
setSchema(FormatSchema schema)
Method to call to make this parser use specified schema.
|
abstract
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
START_OBJECT or START_ARRAY .
|
abstract
Version
|
version()
Accessor for getting version of the core package, given a parser instance.
|