Package org.glassfish.json
Class JsonWriterImpl
java.lang.Object
org.glassfish.json.JsonWriterImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,JsonWriter
JsonWriter impl using generator.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JsonGeneratorImplprivate final JsonWriterImpl.NoFlushOutputStreamprivate static final Charsetprivate boolean -
Constructor Summary
ConstructorsConstructorDescriptionJsonWriterImpl(OutputStream out, boolean prettyPrinting, BufferPool bufferPool) JsonWriterImpl(OutputStream out, Charset charset, boolean prettyPrinting, BufferPool bufferPool) JsonWriterImpl(OutputStream out, BufferPool bufferPool) JsonWriterImpl(Writer writer, boolean prettyPrinting, BufferPool bufferPool) JsonWriterImpl(Writer writer, BufferPool bufferPool) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this JSON writer and frees any resources associated with the writer.voidwrite(JsonStructure value) voidwriteArray(JsonArray array) Writes the specified JSONarrayto the output source.voidwriteObject(JsonObject object) Writes the specified JSONobjectto the output source.
-
Field Details
-
UTF_8
-
generator
-
writeDone
private boolean writeDone -
os
-
-
Constructor Details
-
JsonWriterImpl
JsonWriterImpl(Writer writer, BufferPool bufferPool) -
JsonWriterImpl
JsonWriterImpl(Writer writer, boolean prettyPrinting, BufferPool bufferPool) -
JsonWriterImpl
JsonWriterImpl(OutputStream out, BufferPool bufferPool) -
JsonWriterImpl
JsonWriterImpl(OutputStream out, boolean prettyPrinting, BufferPool bufferPool) -
JsonWriterImpl
JsonWriterImpl(OutputStream out, Charset charset, boolean prettyPrinting, BufferPool bufferPool)
-
-
Method Details
-
writeArray
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
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
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
-
close
public void close()Description copied from interface:JsonWriterCloses this JSON writer and frees any resources associated with the writer. This method closes the underlying output source.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceJsonWriter
-