class JsonWriterImpl extends java.lang.Object implements JsonWriter
| Modifier and Type | Class and Description |
|---|---|
private static class |
JsonWriterImpl.NoFlushOutputStream |
| Modifier and Type | Field and Description |
|---|---|
private JsonGeneratorImpl |
generator |
private JsonWriterImpl.NoFlushOutputStream |
os |
private static java.nio.charset.Charset |
UTF_8 |
private boolean |
writeDone |
| Constructor and Description |
|---|
JsonWriterImpl(java.io.OutputStream out,
boolean prettyPrinting,
BufferPool bufferPool) |
JsonWriterImpl(java.io.OutputStream out,
BufferPool bufferPool) |
JsonWriterImpl(java.io.OutputStream out,
java.nio.charset.Charset charset,
boolean prettyPrinting,
BufferPool bufferPool) |
JsonWriterImpl(java.io.Writer writer,
boolean prettyPrinting,
BufferPool bufferPool) |
JsonWriterImpl(java.io.Writer writer,
BufferPool bufferPool) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this JSON writer and frees any resources associated with the
writer.
|
void |
write(JsonStructure value)
|
void |
writeArray(JsonArray array)
Writes the specified JSON
array to the output
source. |
void |
writeObject(JsonObject object)
Writes the specified JSON
object to the output
source. |
private static final java.nio.charset.Charset UTF_8
private final JsonGeneratorImpl generator
private boolean writeDone
private final JsonWriterImpl.NoFlushOutputStream os
JsonWriterImpl(java.io.Writer writer,
BufferPool bufferPool)
JsonWriterImpl(java.io.Writer writer,
boolean prettyPrinting,
BufferPool bufferPool)
JsonWriterImpl(java.io.OutputStream out,
BufferPool bufferPool)
JsonWriterImpl(java.io.OutputStream out,
boolean prettyPrinting,
BufferPool bufferPool)
JsonWriterImpl(java.io.OutputStream out,
java.nio.charset.Charset charset,
boolean prettyPrinting,
BufferPool bufferPool)
public void writeArray(JsonArray array)
JsonWriterarray to the output
source. This method needs to be called only once for a writer instance.writeArray in interface JsonWriterarray - JSON array that is to be written to the output sourcepublic void writeObject(JsonObject object)
JsonWriterobject to the output
source. This method needs to be called only once for a writer instance.writeObject in interface JsonWriterobject - JSON object that is to be written to the output sourcepublic void write(JsonStructure value)
JsonWriterobject or
array to the output source. This method needs
to be called only once for a writer instance.write in interface JsonWritervalue - JSON array or object that is to be written to the output
sourcepublic void close()
JsonWriterclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface JsonWriter