JrsValue that implements JsonParser to allow
accessing contents of JSON tree in alternate form (stream of tokens).
Useful when a streaming source is expected by code, such as data binding
functionality.
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | _closed
Flag that indicates whether parser is closed or not.
|
| protected JsonToken | _nextToken
Sometimes parser needs to buffer a single look-ahead token; if so, it'll be stored here. |
| protected JrsValueCursor | _nodeCursor
Traversal context within tree |
| protected final JrsValue | _source
Value node that this parser exposes as a token stream. |
| protected boolean | _startContainer
Flag needed to handle recursion into contents of child Array/Object nodes. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | _closeInput()
Implements abstract tools. Abstract method for sub-classes to implement; to be called by
|
| protected void | _handleEOF()
Implements abstract tools. Method sub-classes need to implement to check whether end-of-content is allowed at the current decoding position: formats often want to verify the all start/end token pairs match, for example. |
| protected void | _releaseBuffers()
Implements abstract tools. Method called to release internal buffers owned by the base reader. |
| public void | assignCurrentValue(Object v)
Implements abstract tools. Helper method, usually equivalent to:
|
| public void | close()
Overrides tools. Implements java. 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
|
| public TokenStreamLocation | currentLocation()
Implements abstract tools. Method that returns location of the last processed character; usually for error reporting purposes. |
| public String | currentName()
Implements abstract tools. Method that can be called to get the name associated with
the current token: for |
| protected JrsValue | |
| protected JrsNumber | |
| protected Number | |
| public TokenStreamLocation | currentTokenLocation()
Implements abstract tools. Method that return the starting location of the current token; that is, position of the first character from input that starts the current token. |
| public Object | currentValue()
Implements abstract tools. Helper method, usually equivalent to:
Note that "current value" is NOT populated (or used) by Streaming parser; it is only used by higher-level data-binding functionality. |
| public BigInteger | getBigIntegerValue()
Implements abstract tools. Numeric accessor that can be called when the current
token is of type |
| public byte[] | getBinaryValue(Base64Variant b64variant)
Implements abstract tools. 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. |
| public BigDecimal | getDecimalValue()
Implements abstract tools. Numeric accessor that can be called when the current
token is of type |
| public double | getDoubleValue()
Implements abstract tools. Numeric accessor that can be called when the current
token is of type |
| public Object | getEmbeddedObject()
Overrides tools. Accessor that can be called if (and only if) the current token
is |
| public float | getFloatValue()
Implements abstract tools. Numeric accessor that can be called when the current
token is of type |
| public int | getIntValue()
Implements abstract tools. Numeric accessor that can be called when the current
token is of type |
| public long | getLongValue()
Implements abstract tools. Numeric accessor that can be called when the current
token is of type |
| public JsonParser. | getNumberType()
Implements abstract tools. If current token is of type
|
| public Number | getNumberValue()
Implements abstract tools. Generic number value accessor method that will work for all kinds of numeric values. |
| public String | getString()
Implements abstract tools. Method for accessing textual representation of the current token;
if no current token (before first call to |
| public char[] | getStringCharacters()
Implements abstract tools. Method similar to |
| public int | getStringLength()
Implements abstract tools. Accessor used with |
| public int | getStringOffset()
Implements abstract tools. Accessor used with |
| public boolean | hasStringCharacters()
Implements abstract tools. Method that can be used to determine whether calling of
|
| public boolean | isClosed()
Overrides tools. Method that can be called to determine whether this parser is closed or not. |
| public boolean | isNaN()
Implements abstract tools. Accessor for checking whether current token is a special "not-a-number" (NaN) token (including both "NaN" AND positive/negative infinity!). |
| public JsonToken | nextToken()
Implements abstract tools. Main iteration method, which will advance stream enough to determine type of the next token, if any. |
| public int | readBinaryValue(Base64Variant b64variant, OutputStream out)
Overrides tools. Similar to |
| public JsonParser | skipChildren()
Overrides tools. Method that will skip all child tokens of an array or
object token that the parser currently points to,
iff stream points to
|
| public JacksonFeatureSet | streamReadCapabilities()
Overrides tools. Accessor for getting metadata on capabilities of this parser, based on underlying data format being read (directly or indirectly). |
| public TokenStreamContext | streamReadContext()
Implements abstract tools. Method that can be used to access current parsing context reader is in. There are 3 different types: root, array and object contexts, with slightly different available information. |
| public Object | streamReadInputSource()
Implements abstract tools. Method that can be used to get access to object that is used
to access input being parsed; this is usually either
|
| public Version | version()
Implements abstract tools. Implements tools. Accessor for getting version of the core package, given a parser instance. |
| _closed | back to summary |
|---|---|
| protected boolean _closed Hides tools. Flag that indicates whether parser is closed or not. Gets
set when parser is either closed by explicit call
( | |
| _nextToken | back to summary |
|---|---|
| protected JsonToken _nextToken Sometimes parser needs to buffer a single look-ahead token; if so, it'll be stored here. This is currently used for handling | |
| _nodeCursor | back to summary |
|---|---|
| protected JrsValueCursor _nodeCursor Traversal context within tree | |
| _source | back to summary |
|---|---|
| protected final JrsValue _source Value node that this parser exposes as a token stream. | |
| _startContainer | back to summary |
|---|---|
| protected boolean _startContainer Flag needed to handle recursion into contents of child Array/Object nodes. | |
| JrsTreeTraversingParser | back to summary |
|---|---|
| public JrsTreeTraversingParser(ObjectReadContext readCtxt, JrsValue n) | |
| _closeInput | back to summary |
|---|---|
| protected void _closeInput() Implements abstract tools. Doc from tools. Abstract method for sub-classes to implement; to be called by
| |
| _handleEOF | back to summary |
|---|---|
| protected void _handleEOF() Implements abstract tools. Doc from tools. Method sub-classes need to implement to check whether end-of-content is allowed at the current decoding position: formats often want to verify the all start/end token pairs match, for example.
| |
| _releaseBuffers | back to summary |
|---|---|
| protected void _releaseBuffers() Implements abstract tools. Doc from tools. Method called to release internal buffers owned by the base
reader. This is expected to be called after
| |
| assignCurrentValue | back to summary |
|---|---|
| public void assignCurrentValue(Object v) Implements abstract tools. Doc from tools. Helper method, usually equivalent to:
| |
| close | back to summary |
|---|---|
| public void close() Overrides tools. Implements java. Doc from tools. 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
| |
| currentLocation | back to summary |
|---|---|
| public TokenStreamLocation currentLocation() Implements abstract tools. Doc from tools. Method that returns location of the last processed character; usually for error reporting purposes.
Note that the location is not guaranteed to be accurate (although most
implementation will try their best): some implementations may only
report specific boundary locations (start or end locations of tokens)
and others only return
| |
| currentName | back to summary |
|---|---|
| public String currentName() Implements abstract tools. Doc from tools. Method that can be called to get the name associated with
the current token: for
| |
| currentNode | back to summary |
|---|---|
| protected JrsValue currentNode() | |
| currentNumericNode | back to summary |
|---|---|
| protected JrsNumber currentNumericNode() | |
| currentNumericValue | back to summary |
|---|---|
| protected Number currentNumericValue() | |
| currentTokenLocation | back to summary |
|---|---|
| public TokenStreamLocation currentTokenLocation() Implements abstract tools. Doc from tools. Method that return the starting location of the current token; that is, position of the first character from input that starts the current token.
Note that the location is not guaranteed to be accurate (although most
implementation will try their best): some implementations may only
return
| |
| currentValue | back to summary |
|---|---|
| public Object currentValue() Implements abstract tools. Doc from tools. Helper method, usually equivalent to:
Note that "current value" is NOT populated (or used) by Streaming parser; it is only used by higher-level data-binding functionality. The reason it is included here is that it can be stored and accessed hierarchically, and gets passed through data-binding.
| |
| getBigIntegerValue | back to summary |
|---|---|
| public BigInteger getBigIntegerValue() throws JacksonException Implements abstract tools. Doc from tools. Numeric accessor that can be called when the current
token is of type
| |
| getBinaryValue | back to summary |
|---|---|
| public byte[] getBinaryValue(Base64Variant b64variant) throws JacksonException Implements abstract tools. Doc from tools. 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.
It works similar to getting String value via Note that non-decoded textual contents of the current token are not guaranteed to be accessible after this method is called. Current implementation, for example, clears up textual content during decoding. Decoded binary content, however, will be retained until parser is advanced to the next event.
| |
| getDecimalValue | back to summary |
|---|---|
| public BigDecimal getDecimalValue() throws JacksonException Implements abstract tools. Doc from tools. Numeric accessor that can be called when the current
token is of type
| |
| getDoubleValue | back to summary |
|---|---|
| public double getDoubleValue() throws JacksonException Implements abstract tools. Doc from tools. Numeric accessor that can be called when the current
token is of type Note if the value falls
outside of range of Java double, a
| |
| getEmbeddedObject | back to summary |
|---|---|
| public Object getEmbeddedObject() Overrides tools. Doc from tools. Accessor that can be called if (and only if) the current token
is Note only some specialized parser implementations support
embedding of objects (usually ones that are facades on top
of non-streaming sources, such as object trees). One exception
is access to binary content (whether via base64 encoding or not)
which typically is accessible using this method, as well as
| |
| getFloatValue | back to summary |
|---|---|
| public float getFloatValue() throws JacksonException Implements abstract tools. Doc from tools. Numeric accessor that can be called when the current
token is of type Note if the value falls
outside of range of Java float, a
| |
| getIntValue | back to summary |
|---|---|
| public int getIntValue() throws JacksonException Implements abstract tools. Doc from tools. Numeric accessor that can be called when the current
token is of type Note if the resulting integer value falls outside range of
Java
| |
| getLongValue | back to summary |
|---|---|
| public long getLongValue() throws JacksonException Implements abstract tools. Doc from tools. Numeric accessor that can be called when the current
token is of type Note if the token is an integer, but its value falls
outside of range of Java long, a
| |
| getNumberType | back to summary |
|---|---|
| public JsonParser. Implements abstract tools. Doc from tools. If current token is of type
Note in Jackson 2.x, an exception was wrong if called for non-numeric token.
| |
| getNumberValue | back to summary |
|---|---|
| public Number getNumberValue() throws JacksonException Implements abstract tools. Doc from tools. Generic number value accessor method that will work for all kinds of numeric values. It will return the optimal (simplest/smallest possible) wrapper object that can express the numeric value just parsed.
| |
| getString | back to summary |
|---|---|
| public String getString() Implements abstract tools. Doc from tools. Method for accessing textual representation of the current token;
if no current token (before first call to
| |
| getStringCharacters | back to summary |
|---|---|
| public char[] getStringCharacters() throws JacksonException Implements abstract tools. Doc from tools. Method similar to
Note that caller MUST NOT modify the returned character array in any way -- doing so may corrupt current parser state and render parser instance useless.
The only reason to call this method (over
| |
| getStringLength | back to summary |
|---|---|
| public int getStringLength() throws JacksonException Implements abstract tools. Doc from tools. Accessor used with
| |
| getStringOffset | back to summary |
|---|---|
| public int getStringOffset() throws JacksonException Implements abstract tools. Doc from tools. Accessor used with
| |
| hasStringCharacters | back to summary |
|---|---|
| public boolean hasStringCharacters() Implements abstract tools. Doc from tools. Method that can be used to determine whether calling of
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Overrides tools. Doc from tools. Method that can be called to determine whether this parser
is closed or not. If it is closed, no new tokens can be
retrieved by calling
| |
| isNaN | back to summary |
|---|---|
| public boolean isNaN() Implements abstract tools. Doc from tools. Accessor for checking whether current token is a special
"not-a-number" (NaN) token (including both "NaN" AND
positive/negative infinity!). These values are not supported by all formats:
JSON, for example, only supports them if
Note in case where numeric value is outside range of requested type --
most notably
| |
| nextToken | back to summary |
|---|---|
| public JsonToken nextToken() throws JacksonException Implements abstract tools. Doc from tools. Main iteration method, which will advance stream enough to determine type of the next token, if any. If none remaining (stream has no content other than possible white space before ending), null will be returned.
| |
| readBinaryValue | back to summary |
|---|---|
| public int readBinaryValue(Base64Variant b64variant, OutputStream out) throws JacksonException Overrides tools. Doc from tools. Similar to
| |
| skipChildren | back to summary |
|---|---|
| public JsonParser skipChildren() throws JacksonException Overrides tools. Doc from tools. Method that will skip all child tokens of an array or
object token that the parser currently points to,
iff stream points to
| |
| streamReadCapabilities | back to summary |
|---|---|
| public JacksonFeatureSet Overrides tools. Doc from tools. Accessor for getting metadata on capabilities of this parser, based on underlying data format being read (directly or indirectly).
| |
| streamReadContext | back to summary |
|---|---|
| public TokenStreamContext streamReadContext() Implements abstract tools. Doc from tools. Method that can be used to access current parsing context reader is in. There are 3 different types: root, array and object contexts, with slightly different available information. Contexts are hierarchically nested, and can be used for example for figuring out part of the input document that correspond to specific array or object (for highlighting purposes, or error reporting). Contexts can also be used for simple xpath-like matching of input, if so desired. Note method was called
| |
| streamReadInputSource | back to summary |
|---|---|
| public Object streamReadInputSource() Implements abstract tools. Doc from tools. Method that can be used to get access to object that is used
to access input being parsed; this is usually either
In general use of this accessor should be considered as "last effort", i.e. only used if no other mechanism is applicable. Note was named
| |
| version | back to summary |
|---|---|
| public Version version() Implements abstract tools. Implements tools. Doc from tools. Accessor for getting version of the core package, given a parser instance. Left for sub-classes to implement.
| |