T - the type of object returned by this iteratorpublic class JsonIterator<T> extends Object implements Iterator<T>, Closeable
ObjectCodec to deserialize regular Java objects.| Constructor and Description |
|---|
JsonIterator(com.fasterxml.jackson.core.type.TypeReference typeRef,
InputStream inputStream,
Closeable resourceCloser,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
hasNext()
Returns
true if there are more objects to be read. |
T |
next()
Retrieves the next deserialized object from the stream of JSON objects.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, removepublic JsonIterator(com.fasterxml.jackson.core.type.TypeReference typeRef,
InputStream inputStream,
Closeable resourceCloser,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
typeRef - the object type that the JSON object should be deserialized intoinputStream - stream containing an array of JSON objectsresourceCloser - a Closeable implementation to release resources that the object is holdingobjectMapper - object mapper, used for deserializationpublic boolean hasNext()
true if there are more objects to be read.public T next()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2011–2018 The Apache Software Foundation. All rights reserved.