com.fasterxml.jackson.databind

Class MappingIterator<T>

    • Field Detail

      • _parser

        protected com.fasterxml.jackson.core.JsonParser _parser
      • _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.
    • Constructor Detail

      • MappingIterator

        protected MappingIterator(JavaType type,
                       com.fasterxml.jackson.core.JsonParser jp,
                       DeserializationContext ctxt,
                       JsonDeserializer<?> deser,
                       boolean managedParser,
                       Object valueToUpdate)
        Parameters:
        managedParser - Whether we "own" the 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.
    • Method Detail

      • hasNext

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

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

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

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

        public List<T> readAll()
                        throws IOException
        Convenience method for reading all entries accessible via this iterator
        Returns:
        List of entries read
        Throws:
        IOException
        Since:
        2.2
      • readAll

        public List<T> readAll(List<T> resultList)
                        throws IOException
        Convenience method for reading all entries accessible via this iterator
        Returns:
        List of entries read (same as passed-in argument)
        Throws:
        IOException
        Since:
        2.2
      • getParser

        public com.fasterxml.jackson.core.JsonParser getParser()
        Accessor for getting underlying parser this iterator uses.
        Since:
        2.2
      • getParserSchema

        public com.fasterxml.jackson.core.FormatSchema getParserSchema()
        Accessor for accessing FormatSchema that the underlying parser (as per getParser()) is using, if any; only parser of schema-aware formats use schemas.
        Since:
        2.2
      • getCurrentLocation

        public com.fasterxml.jackson.core.JsonLocation getCurrentLocation()
        Convenience method, functionally equivalent to: iterator.getParser().getCurrentLocation()
        Returns:
        Location of the input stream of the underlying parser
        Since:
        2.2.1

Copyright © 2014 FasterXML. All Rights Reserved.