类 JsonStream
java.lang.Object
org.springframework.boot.buildpack.platform.json.JsonStream
Utility class that allows JSON to be parsed and processed as it's received.
- 从以下版本开始:
- 2.3.0
- 作者:
- Phillip Webb
-
构造器概要
构造器构造器说明JsonStream(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Create a newJsonStreambacked by the given object mapper. -
方法概要
修饰符和类型方法说明<T> voidget(InputStream content, Class<T> type, Consumer<T> consumer) Stream objects from the content as they become available.voidget(InputStream content, Consumer<com.fasterxml.jackson.databind.node.ObjectNode> consumer) Streamobject nodesfrom the content as they become available.
-
构造器详细资料
-
JsonStream
public JsonStream(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Create a newJsonStreambacked by the given object mapper.- 参数:
objectMapper- the object mapper to use
-
-
方法详细资料
-
get
public void get(InputStream content, Consumer<com.fasterxml.jackson.databind.node.ObjectNode> consumer) throws IOException Streamobject nodesfrom the content as they become available.- 参数:
content- the source contentconsumer- theObjectNodeconsumer- 抛出:
IOException- on IO error
-
get
Stream objects from the content as they become available.- 类型参数:
T- the object type- 参数:
content- the source contenttype- the object typeconsumer- theObjectNodeconsumer- 抛出:
IOException- on IO error
-