JsonParser that will use an underlying
IonReader as actual parser, and camouflage it as json parser.
Will not expose all Ion info (specifically, annotations)
| Modifier and Type | Field and Description |
|---|---|
| protected int | _formatFeatures
Bit flag composed of bits that indicate which
|
| protected final IonReader | |
| protected SimpleStreamReadContext | _streamReadContext
Information about context in structure hierarchy |
| private final IonSystem | |
| protected JsonToken | _valueToken
Type of value token we have; used to temporarily hold information when pointing to field name |
| protected static final JacksonFeatureSet |
| Access | Constructor and Description |
|---|---|
| public | IonParser(ObjectReadContext readCtxt, IOContext ioCtxt, int streamReadFeatures, int formatFeatures, IonReader r, IonSystem system)
|
| Modifier and Type | Method and Description |
|---|---|
| private byte[] | |
| protected void | _closeInput()
Implements abstract tools. Abstract method for sub-classes to implement; to be called by
|
| private BigDecimal | |
| private BigInteger | |
| private double | |
| private int | |
| private long | |
| protected void | _handleEOF()
Implements abstract tools. Method called when an EOF is encountered between tokens. |
| protected void | _releaseBuffers()
Implements abstract tools. Method called to release internal buffers owned by the base reader. |
| private <T> T | |
| private <T> T | |
| private Timestamp | |
| protected JsonToken | |
| private void | |
| public void | assignCurrentValue(Object v)
Implements abstract tools. Helper method, usually equivalent to:
|
| public boolean | canReadTypeId()
Overrides tools. Introspection method that may be called to see if the underlying data format supports some kind of Type Ids natively (many do not; for example, JSON doesn't). |
| 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 |
| 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 arg0)
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 IonSystem | Returns: IonSystem instanceAccessor for |
| private IonValue | |
| 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 JsonParser. | getNumberTypeFP()
Overrides 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 final Number | getNumberValueExact()
Overrides tools. Method similar to |
| 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 String[] | |
| public Object | getTypeId()
Overrides tools. Method that can be called to check whether current token (one that was just read) has an associated type id, and if so, return it. |
| public boolean | hasStringCharacters()
Implements abstract tools. Method that can be used to determine whether calling of
|
| public IOContext | |
| 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 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 IonReader | 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. |
| _formatFeatures | back to summary |
|---|---|
| protected int _formatFeatures Bit flag composed of bits that indicate which
| |
| _reader | back to summary |
|---|---|
| protected final IonReader _reader | |
| _streamReadContext | back to summary |
|---|---|
| protected SimpleStreamReadContext _streamReadContext Information about context in structure hierarchy | |
| _system | back to summary |
|---|---|
| private final IonSystem _system | |
| _valueToken | back to summary |
|---|---|
| protected JsonToken _valueToken Type of value token we have; used to temporarily hold information when pointing to field name | |
| ION_READ_CAPABILITIES | back to summary |
|---|---|
| protected static final JacksonFeatureSet<StreamReadCapability> ION_READ_CAPABILITIES | |
| IonParser | back to summary |
|---|---|
| public IonParser(ObjectReadContext readCtxt, IOContext ioCtxt, int streamReadFeatures, int formatFeatures, IonReader r, IonSystem system) | |
| _bytesFromIonReader | back to summary |
|---|---|
| private byte[] _bytesFromIonReader() throws JacksonException | |
| _closeInput | back to summary |
|---|---|
| protected void _closeInput() throws IOException Implements abstract tools. Doc from tools. Abstract method for sub-classes to implement; to be called by
| |
| _getBigDecimalValue | back to summary |
|---|---|
| private BigDecimal _getBigDecimalValue() throws JacksonException | |
| _getBigIntegerValue | back to summary |
|---|---|
| private BigInteger _getBigIntegerValue() throws JacksonException | |
| _getDoubleValue | back to summary |
|---|---|
| private double _getDoubleValue() throws JacksonException | |
| _getIntValue | back to summary |
|---|---|
| private int _getIntValue() throws JacksonException | |
| _getLongValue | back to summary |
|---|---|
| private long _getLongValue() throws JacksonException | |
| _handleEOF | back to summary |
|---|---|
| protected void _handleEOF() throws StreamReadException Implements abstract tools. Method called when an EOF is encountered between tokens.
| |
| _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
| |
| _reportCorruptContent | back to summary |
|---|---|
| private <T> T _reportCorruptContent(Throwable e) throws StreamReadException | |
| _reportCorruptNumber | back to summary |
|---|---|
| private <T> T _reportCorruptNumber(Throwable e) throws StreamReadException | |
| _timestampFromIonReader | back to summary |
|---|---|
| private Timestamp _timestampFromIonReader() throws JacksonException | |
| _tokenFromType | back to summary |
|---|---|
| protected JsonToken _tokenFromType(IonType type) | |
| _verifyIsNumberToken | back to summary |
|---|---|
| private void _verifyIsNumberToken() throws JacksonException | |
| assignCurrentValue | back to summary |
|---|---|
| public void assignCurrentValue(Object v) Implements abstract tools. Doc from tools. Helper method, usually equivalent to:
| |
| canReadTypeId | back to summary |
|---|---|
| public boolean canReadTypeId() Overrides tools. Doc from tools. Introspection method that may be called to see if the underlying data format supports some kind of Type Ids natively (many do not; for example, JSON doesn't). Default implementation returns true; overridden by data formats that do support native Type Ids. Caller is expected to either use a non-native notation (explicit property or such), or fail, in case it cannot use native type ids.
| |
| 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() throws JacksonException Implements abstract tools. Doc from tools. Method that can be called to get the name associated with
the current token: for
| |
| 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 arg0) 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() throws JacksonException 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
| |
| getIonSystem | back to summary |
|---|---|
| public IonSystem getIonSystem() Accessor for | |
| getIonValue | back to summary |
|---|---|
private IonValue getIonValue() throws JacksonException
| |
| 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.
| |
| getNumberTypeFP | back to summary |
|---|---|
| public JsonParser. Overrides tools. Doc from tools. If current token is of type
| |
| 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.
| |
| getNumberValueExact | back to summary |
|---|---|
| public final Number getNumberValueExact() throws JacksonException Overrides tools. Doc from tools. Method similar to
Default implementation simply returns
| |
| getString | back to summary |
|---|---|
| public String getString() throws JacksonException 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
| |
| getTypeAnnotations | back to summary |
|---|---|
| public String[] getTypeAnnotations() throws JacksonException | |
| getTypeId | back to summary |
|---|---|
| public Object getTypeId() throws JacksonException Overrides tools. Doc from tools. Method that can be called to check whether current token
(one that was just read) has an associated type id, and if
so, return it.
Note that while typically caller should check with Default implementation will simply return null.
| |
| hasStringCharacters | back to summary |
|---|---|
| public boolean hasStringCharacters() Implements abstract tools. Doc from tools. Method that can be used to determine whether calling of
| |
| ioContext | back to summary |
|---|---|
| public IOContext ioContext() Accessor needed for testing | |
| isNaN | back to summary |
|---|---|
| public boolean isNaN() throws JacksonException 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.
| |
| 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 IonReader 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.
| |