Class MappingIterator<T>

  • All Implemented Interfaces:
    java.util.Iterator<T>

    public class MappingIterator<T>
    extends java.lang.Object
    implements java.util.Iterator<T>
    Iterator exposed by ObjectMapper when binding sequence of objects. Extension is done to allow more convenient exposing of IOException (which basic Iterator does not expose)
    Since:
    1.8
    • Field Detail

      • _closeParser

        protected final 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.
      • _hasNextChecked

        protected boolean _hasNextChecked
        Flag that is set when we have determined what hasNextValue() should value; reset when nextValue() is called
      • _updatedValue

        protected final T _updatedValue
        If not null, "value to update" instead of creating a new instance for each call.
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<T>
      • next

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<T>
      • hasNextValue

        public boolean hasNextValue()
                             throws java.io.IOException
        Equivalent of next() but one that may throw checked exceptions from Jackson due to invalid input.
        Throws:
        java.io.IOException
      • nextValue

        public T nextValue()
                    throws java.io.IOException
        Throws:
        java.io.IOException