Class JsonWriterImpl

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, JsonWriter

    class JsonWriterImpl
    extends java.lang.Object
    implements JsonWriter
    JsonWriter impl using generator.
    • Constructor Detail

      • JsonWriterImpl

        JsonWriterImpl​(java.io.Writer writer,
                       BufferPool bufferPool)
      • JsonWriterImpl

        JsonWriterImpl​(java.io.Writer writer,
                       boolean prettyPrinting,
                       BufferPool bufferPool)
      • JsonWriterImpl

        JsonWriterImpl​(java.io.OutputStream out,
                       BufferPool bufferPool)
      • JsonWriterImpl

        JsonWriterImpl​(java.io.OutputStream out,
                       boolean prettyPrinting,
                       BufferPool bufferPool)
      • JsonWriterImpl

        JsonWriterImpl​(java.io.OutputStream out,
                       java.nio.charset.Charset charset,
                       boolean prettyPrinting,
                       BufferPool bufferPool)
    • Method Detail

      • writeArray

        public void writeArray​(JsonArray array)
        Description copied from interface: JsonWriter
        Writes the specified JSON array to the output source. This method needs to be called only once for a writer instance.
        Specified by:
        writeArray in interface JsonWriter
        Parameters:
        array - JSON array that is to be written to the output source
      • writeObject

        public void writeObject​(JsonObject object)
        Description copied from interface: JsonWriter
        Writes the specified JSON object to the output source. This method needs to be called only once for a writer instance.
        Specified by:
        writeObject in interface JsonWriter
        Parameters:
        object - JSON object that is to be written to the output source
      • write

        public void write​(JsonStructure value)
        Description copied from interface: JsonWriter
        Writes the specified JSON object or array to the output source. This method needs to be called only once for a writer instance.
        Specified by:
        write in interface JsonWriter
        Parameters:
        value - JSON array or object that is to be written to the output source
      • close

        public void close()
        Description copied from interface: JsonWriter
        Closes this JSON writer and frees any resources associated with the writer. This method closes the underlying output source.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface JsonWriter