Package org.codehaus.jackson.map
Class MappingIterator<T>
- java.lang.Object
-
- org.codehaus.jackson.map.MappingIterator<T>
-
- All Implemented Interfaces:
Iterator<T>
public class MappingIterator<T> extends Object implements Iterator<T>
Iterator exposed byObjectMapper
when binding sequence of objects. Extension is done to allow more convenient exposing ofIOException
(which basicIterator
does not expose)- Since:
- 1.8
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
_closeParser
Flag that indicates whether inputJsonParser
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 whathasNextValue()
should value; reset whennextValue()
is calledprotected 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
-
Constructor Summary
Constructors Modifier Constructor 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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static <T> MappingIterator<T>
emptyIterator()
boolean
hasNext()
boolean
hasNextValue()
Equivalent ofnext()
but one that may throw checked exceptions from Jackson due to invalid input.T
next()
T
nextValue()
void
remove()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
EMPTY_ITERATOR
protected static final MappingIterator<?> EMPTY_ITERATOR
-
_type
protected final JavaType _type
-
_context
protected final DeserializationContext _context
-
_deserializer
protected final JsonDeserializer<T> _deserializer
-
_parser
protected JsonParser _parser
-
_closeParser
protected final boolean _closeParser
Flag that indicates whether inputJsonParser
should be closed when we are done or not; generally only called when caller did not pass JsonParser.
-
_hasNextChecked
protected boolean _hasNextChecked
Flag that is set when we have determined whathasNextValue()
should value; reset whennextValue()
is called
-
_updatedValue
protected final T _updatedValue
If not null, "value to update" instead of creating a new instance for each call.
-
-
Constructor Detail
-
MappingIterator
protected MappingIterator(JavaType type, JsonParser jp, DeserializationContext ctxt, JsonDeserializer<?> deser)
-
MappingIterator
protected MappingIterator(JavaType type, JsonParser jp, DeserializationContext ctxt, JsonDeserializer<?> deser, boolean closeParser, Object valueToUpdate)
- Since:
- 1.9.3
-
-
Method Detail
-
emptyIterator
protected static <T> MappingIterator<T> emptyIterator()
-
hasNextValue
public boolean hasNextValue() throws IOException
Equivalent ofnext()
but one that may throw checked exceptions from Jackson due to invalid input.- Throws:
IOException
-
nextValue
public T nextValue() throws IOException
- Throws:
IOException
-
-