public class JsonStream extends Object
Constructor and Description |
---|
JsonStream(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Create a new
JsonStream backed by the given object mapper. |
Modifier and Type | Method and Description |
---|---|
<T> void |
get(InputStream content,
Class<T> type,
Consumer<T> consumer)
Stream objects from the content as they become available.
|
void |
get(InputStream content,
Consumer<com.fasterxml.jackson.databind.node.ObjectNode> consumer)
Stream
object nodes from the content as they become available. |
public JsonStream(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
JsonStream
backed by the given object mapper.objectMapper
- the object mapper to usepublic void get(InputStream content, Consumer<com.fasterxml.jackson.databind.node.ObjectNode> consumer) throws IOException
object nodes
from the content as they become available.content
- the source contentconsumer
- the ObjectNode
consumerIOException
- on IO errorpublic <T> void get(InputStream content, Class<T> type, Consumer<T> consumer) throws IOException
T
- the object typecontent
- the source contenttype
- the object typeconsumer
- the ObjectNode
consumerIOException
- on IO error