public class MappingIterator<T> extends Object implements Iterator<T>
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 boolean |
_closeParser
Flag that indicates whether input
JsonParser should be closed
when we are done or not; generally only called when caller did not
pass JsonParser. |
protected DeserializationContext |
_context |
protected JsonDeserializer<T> |
_deserializer |
protected boolean |
_hasNextChecked
Flag that is set when we have determined what
hasNextValue()
should value; reset when nextValue() is called |
protected JsonParser |
_parser |
protected JavaType |
_type |
protected T |
_updatedValue
If not null, "value to update" instead of creating a new instance
for each call.
|
protected static MappingIterator<?> |
EMPTY_ITERATOR |
Modifier | Constructor and Description |
---|---|
protected |
MappingIterator(JavaType type,
JsonParser jp,
DeserializationContext ctxt,
JsonDeserializer<?> deser) |
protected |
MappingIterator(JavaType type,
JsonParser jp,
DeserializationContext ctxt,
JsonDeserializer<?> deser,
boolean closeParser,
Object valueToUpdate) |
Modifier and Type | Method and Description |
---|---|
protected static <T> MappingIterator<T> |
emptyIterator() |
boolean |
hasNext() |
boolean |
hasNextValue()
Equivalent of
next() but one that may throw checked
exceptions from Jackson due to invalid input. |
T |
next() |
T |
nextValue() |
void |
remove() |
protected static final MappingIterator<?> EMPTY_ITERATOR
protected final JavaType _type
protected final DeserializationContext _context
protected final JsonDeserializer<T> _deserializer
protected JsonParser _parser
protected final boolean _closeParser
JsonParser
should be closed
when we are done or not; generally only called when caller did not
pass JsonParser.protected boolean _hasNextChecked
hasNextValue()
should value; reset when nextValue()
is calledprotected final T _updatedValue
protected MappingIterator(JavaType type, JsonParser jp, DeserializationContext ctxt, JsonDeserializer<?> deser)
protected MappingIterator(JavaType type, JsonParser jp, DeserializationContext ctxt, JsonDeserializer<?> deser, boolean closeParser, Object valueToUpdate)
protected static <T> MappingIterator<T> emptyIterator()
public boolean hasNextValue() throws IOException
next()
but one that may throw checked
exceptions from Jackson due to invalid input.IOException
public T nextValue() throws IOException
IOException