Package org.glassfish.json
Class JsonWriterImpl
- java.lang.Object
-
- org.glassfish.json.JsonWriterImpl
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,JsonWriter
class JsonWriterImpl extends java.lang.Object implements JsonWriter
JsonWriter impl using generator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classJsonWriterImpl.NoFlushOutputStream
-
Field Summary
Fields Modifier and Type Field Description private JsonGeneratorImplgeneratorprivate JsonWriterImpl.NoFlushOutputStreamosprivate booleanwriteDone
-
Constructor Summary
Constructors Constructor Description JsonWriterImpl(java.io.OutputStream out, boolean prettyPrinting, BufferPool bufferPool)JsonWriterImpl(java.io.OutputStream out, java.nio.charset.Charset charset, boolean prettyPrinting, BufferPool bufferPool)JsonWriterImpl(java.io.OutputStream out, BufferPool bufferPool)JsonWriterImpl(java.io.Writer writer, boolean prettyPrinting, BufferPool bufferPool)JsonWriterImpl(java.io.Writer writer, BufferPool bufferPool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidwrite(JsonStructure value)voidwrite(JsonValue value)Writes the specifiedJsonValueto the output source.voidwriteArray(JsonArray array)Writes the specified JSONarrayto the output source.voidwriteObject(JsonObject object)Writes the specified JSONobjectto the output source.
-
-
-
Field Detail
-
generator
private final JsonGeneratorImpl generator
-
writeDone
private boolean writeDone
-
os
private final JsonWriterImpl.NoFlushOutputStream os
-
-
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:JsonWriterWrites the specified JSONarrayto the output source. This method needs to be called only once for a writer instance.- Specified by:
writeArrayin interfaceJsonWriter- Parameters:
array- JSON array that is to be written to the output source
-
writeObject
public void writeObject(JsonObject object)
Description copied from interface:JsonWriterWrites the specified JSONobjectto the output source. This method needs to be called only once for a writer instance.- Specified by:
writeObjectin interfaceJsonWriter- Parameters:
object- JSON object that is to be written to the output source
-
write
public void write(JsonStructure value)
Description copied from interface:JsonWriterWrites the specified JSONobjectorarrayto the output source. This method needs to be called only once for a writer instance.- Specified by:
writein interfaceJsonWriter- Parameters:
value- JSON array or object that is to be written to the output source
-
write
public void write(JsonValue value)
Description copied from interface:JsonWriterWrites the specifiedJsonValueto the output source. method needs to be called only once for a write instance.- Specified by:
writein interfaceJsonWriter- Parameters:
value- aJsonValueto be written to the output source
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceJsonWriter
-
-