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 JsonGeneratorImpl
private final JsonWriterImpl.NoFlushOutputStream
private 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 TypeMethodDescriptionvoid
close()
void
write
(JsonStructure value) void
Writes the specifiedJsonValue
to the output source.void
writeArray
(JsonArray array) Writes the specified JSONarray
to the output source.void
writeObject
(JsonObject object) Writes the specified JSONobject
to 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:JsonWriter
Writes the specified JSONarray
to the output source. This method needs to be called only once for a writer instance.- Specified by:
writeArray
in interfaceJsonWriter
- Parameters:
array
- JSON array that is to be written to the output source
-
writeObject
Description copied from interface:JsonWriter
Writes the specified JSONobject
to the output source. This method needs to be called only once for a writer instance.- Specified by:
writeObject
in interfaceJsonWriter
- Parameters:
object
- JSON object that is to be written to the output source
-
write
Description copied from interface:JsonWriter
Writes the specified JSONobject
orarray
to the output source. This method needs to be called only once for a writer instance.- Specified by:
write
in interfaceJsonWriter
- Parameters:
value
- JSON array or object that is to be written to the output source
-
write
Description copied from interface:JsonWriter
Writes the specifiedJsonValue
to the output source. method needs to be called only once for a write instance.- Specified by:
write
in interfaceJsonWriter
- Parameters:
value
- aJsonValue
to be written to the output source
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceJsonWriter
-