java.lang.Object
org.springframework.boot.buildpack.platform.json.JsonStream

public class JsonStream extends Object
Utility class that allows JSON to be parsed and processed as it's received.
从以下版本开始:
2.3.0
作者:
Phillip Webb
  • 构造器详细资料

    • JsonStream

      public JsonStream(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Create a new JsonStream backed 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
      Stream object nodes from the content as they become available.
      参数:
      content - the source content
      consumer - the ObjectNode consumer
      抛出:
      IOException - on IO error
    • get

      public <T> void get(InputStream content, Class<T> type, Consumer<T> consumer) throws IOException
      Stream objects from the content as they become available.
      类型参数:
      T - the object type
      参数:
      content - the source content
      type - the object type
      consumer - the ObjectNode consumer
      抛出:
      IOException - on IO error