ObjectMapper when binding sequence of
objects. Extension is done to allow more convenient exposing of
IOException (which basic Iterator does not expose)
| Modifier and Type | Field and Description |
|---|---|
| protected final boolean | _closeParser
Flag that indicates whether input |
| protected final DeserializationContext | _context
Context for deserialization, needed to pass through to deserializer |
| protected final JsonDeserializer | _deserializer
Deserializer for individual element values. |
| protected final JsonParser | _parser
Underlying parser used for reading content to bind. |
| protected final JsonStreamContext | _seqContext
Context to resynchronize to, in case an exception is encountered but caller wants to try to read more elements. |
| protected int | _state
State of the iterator |
| protected final JavaType | _type
Type to bind individual elements to. |
| protected final T | _updatedValue
If not null, "value to update" instead of creating a new instance for each call. |
| protected static final MappingIterator | |
| protected static final int | STATE_CLOSED
State in which iterator is closed |
| protected static final int | STATE_HAS_VALUE
State in which "hasNextValue()" has been succesfully called and deserializer can be called to fetch value |
| protected static final int | STATE_MAY_HAVE_VALUE
State in which no recovery is needed, but "hasNextValue()" needs to be called first |
| protected static final int | STATE_NEED_RESYNC
State in which value read failed |
| Access | Constructor and Description |
|---|---|
| protected | MappingIterator(JavaType type, JsonParser p, DeserializationContext ctxt, JsonDeserializer<?> deser, boolean
Whether we "own" the managedParser, Object valueToUpdate)JsonParser passed or not:
if true, it was created by ObjectReader and code here needs to
close it; if false, it was passed by calling code and should not be
closed by iterator.
|
| Modifier and Type | Method and Description |
|---|---|
| protected <R> R | |
| protected <R> R | |
| protected void | |
| protected <R> R | |
| public void | close()
Implements java. |
| public static <T> MappingIterator | emptyIterator()
Method for getting an "empty" iterator instance: one that never has more values; may be freely shared. |
| public JsonLocation | Returns: Location of the input stream of the underlying parserConvenience method, functionally equivalent to:
|
| public JsonParser | |
| public FormatSchema | getParserSchema()
Accessor for accessing |
| public boolean | |
| public boolean | hasNextValue()
Equivalent of |
| public T | |
| public T | |
| public List | Returns: List of entries readConvenience method for reading all entries accessible via
this iterator; resulting container will be a |
| public <L extends List | Returns: List of entries read (same as passed-in argument)Convenience method for reading all entries accessible via this iterator |
| public <C extends Collection | |
| public void | remove()
Overrides default java. |
| _closeParser | back to summary |
|---|---|
| protected final boolean _closeParser Flag that indicates whether input | |
| _context | back to summary |
|---|---|
| protected final DeserializationContext _context Context for deserialization, needed to pass through to deserializer | |
| _deserializer | back to summary |
|---|---|
| protected final JsonDeserializer<T> _deserializer Deserializer for individual element values. | |
| _parser | back to summary |
|---|---|
| protected final JsonParser _parser Underlying parser used for reading content to bind. Initialized
as not | |
| _seqContext | back to summary |
|---|---|
| protected final JsonStreamContext _seqContext Context to resynchronize to, in case an exception is encountered but caller wants to try to read more elements. | |
| _state | back to summary |
|---|---|
| protected int _state State of the iterator | |
| _type | back to summary |
|---|---|
| protected final JavaType _type Type to bind individual elements to. | |
| _updatedValue | back to summary |
|---|---|
| protected final T _updatedValue If not null, "value to update" instead of creating a new instance for each call. | |
| EMPTY_ITERATOR | back to summary |
|---|---|
| protected static final MappingIterator<?> EMPTY_ITERATOR | |
| STATE_CLOSED | back to summary |
|---|---|
| protected static final int STATE_CLOSED State in which iterator is closed | |
| STATE_HAS_VALUE | back to summary |
|---|---|
| protected static final int STATE_HAS_VALUE State in which "hasNextValue()" has been succesfully called and deserializer can be called to fetch value | |
| STATE_MAY_HAVE_VALUE | back to summary |
|---|---|
| protected static final int STATE_MAY_HAVE_VALUE State in which no recovery is needed, but "hasNextValue()" needs to be called first | |
| STATE_NEED_RESYNC | back to summary |
|---|---|
| protected static final int STATE_NEED_RESYNC State in which value read failed | |
| MappingIterator | back to summary |
|---|---|
protected MappingIterator(JavaType type, JsonParser p, DeserializationContext ctxt, JsonDeserializer<?> deser, boolean managedParser, Object valueToUpdate)
| |
| _handleIOException | back to summary |
|---|---|
| protected <R> R _handleIOException(IOException e) | |
| _handleMappingException | back to summary |
|---|---|
| protected <R> R _handleMappingException(JsonMappingException e) | |
| _resync | back to summary |
|---|---|
| protected void _resync() throws IOException | |
| _throwNoSuchElement | back to summary |
|---|---|
| protected <R> R _throwNoSuchElement() | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| emptyIterator | back to summary |
|---|---|
| public static <T> MappingIterator Method for getting an "empty" iterator instance: one that never has more values; may be freely shared.
| |
| getCurrentLocation | back to summary |
|---|---|
| public JsonLocation getCurrentLocation() Convenience method, functionally equivalent to:
| |
| getParser | back to summary |
|---|---|
| public JsonParser getParser() Accessor for getting underlying parser this iterator uses.
| |
| getParserSchema | back to summary |
|---|---|
| public FormatSchema getParserSchema() Accessor for accessing
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| hasNextValue | back to summary |
|---|---|
| public boolean hasNextValue() throws IOException Equivalent of | |
| next | back to summary |
|---|---|
| public T next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| nextValue | back to summary |
|---|---|
| public T nextValue() throws IOException | |
| readAll | back to summary |
|---|---|
| public List Convenience method for reading all entries accessible via
this iterator; resulting container will be a
| |
| readAll | back to summary |
|---|---|
| public <L extends List Convenience method for reading all entries accessible via this iterator
| |
| readAll | back to summary |
|---|---|
| public <C extends Collection Convenience method for reading all entries accessible via this iterator
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the
| |