Class JacksonJsonNodeSink

  • All Implemented Interfaces:
    Sink, Closeable, AutoCloseable

    @ProviderType
    public final class JacksonJsonNodeSink
    extends Object
    implements Sink
    Converts the JSON stream elements into JsonNodes.
    • Constructor Detail

      • JacksonJsonNodeSink

        public JacksonJsonNodeSink​(com.fasterxml.jackson.core.JsonFactory factory)
        Parameters:
        factory - JSON factory to initiate the Object Mapper.
    • Method Detail

      • getJsonNode

        public com.fasterxml.jackson.databind.JsonNode getJsonNode()
        Returns:
        The root node
      • write

        public void write​(JsonElement element)
                   throws IOException
        Description copied from interface: Sink
        Takes an JSON element and writes it some where in any format.
        Specified by:
        write in interface Sink
        Parameters:
        element - JSON element
        Throws:
        IOException - Writing error
      • hasOutput

        public boolean hasOutput()
        Specified by:
        hasOutput in interface Sink
        Returns:
        True if any output was written