Class JsonIterator<T>

    • Constructor Detail

      • JsonIterator

        public JsonIterator​(com.fasterxml.jackson.core.type.TypeReference<T> typeRef,
                            InputStream inputStream,
                            Closeable resourceCloser,
                            com.fasterxml.jackson.databind.ObjectMapper objectMapper)
        Parameters:
        typeRef - the object type that the JSON object should be deserialized into
        inputStream - stream containing an array of JSON objects
        resourceCloser - a Closeable implementation to release resources that the object is holding
        objectMapper - object mapper, used for deserialization
    • Method Detail

      • hasNext

        public boolean hasNext()
        Returns true if there are more objects to be read.
        Specified by:
        hasNext in interface Iterator<T>
        Returns:
        true if there are more objects to be read, else return false
      • next

        public T next()
        Retrieves the next deserialized object from the stream of JSON objects.
        Specified by:
        next in interface Iterator<T>
        Returns:
        the next deserialized object from the stream of JSON ovbjects