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 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()voidwrite(JsonStructure value) voidWrites 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 Details
-
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
-
write
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 interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceJsonWriter
-