ObjectWriter, except that it can be used
for writing sequences of values, not just a single value.
The main use case is in writing very long sequences, or sequences where
values are incrementally produced; cases where it would be impractical
or at least inconvenient to construct a wrapper container around values
(or where no JSON array is desired around values).
Differences from ObjectWriter include:
SequenceWriter are stateful, and not thread-safe:
if sharing, external synchronization must be used.
close is needed after all values have been written
(ObjectWriter can auto-close after individual value writes)
| Modifier and Type | Field and Description |
|---|---|
| protected final boolean | |
| protected final boolean | |
| protected boolean | |
| protected final boolean | |
| protected final SerializationConfig | |
| protected PropertySerializerMap | _dynamicSerializers
If |
| protected final JsonGenerator | |
| protected boolean | _openArray
State flag for keeping track of need to write matching END_ARRAY, if a START_ARRAY was written during initialization |
| protected final DefaultSerializerProvider | |
| protected final JsonSerializer | |
| protected final TypeSerializer |
| Access | Constructor and Description |
|---|---|
| public | SequenceWriter(DefaultSerializerProvider prov, JsonGenerator gen, boolean closeGenerator, ObjectWriter.
|
| Modifier and Type | Method and Description |
|---|---|
| private final JsonSerializer | |
| private final JsonSerializer | |
| protected SequenceWriter | |
| protected SequenceWriter | |
| public void | close()
Implements java. |
| public void | flush()
Implements java. |
| public SequenceWriter | init(boolean wrapInArray)
Internal method called by |
| public Version | version()
Implements com. |
| public SequenceWriter | |
| public SequenceWriter | write(Object value, JavaType type)
Method for writing given value into output, as part of sequence
to write; further, full type (often generic, like |
| public SequenceWriter | |
| public <C extends Collection | |
| public SequenceWriter |
| _cfgCloseCloseable | back to summary |
|---|---|
| protected final boolean _cfgCloseCloseable | |
| _cfgFlush | back to summary |
|---|---|
| protected final boolean _cfgFlush | |
| _closed | back to summary |
|---|---|
| protected boolean _closed | |
| _closeGenerator | back to summary |
|---|---|
| protected final boolean _closeGenerator | |
| _config | back to summary |
|---|---|
| protected final SerializationConfig _config | |
| _dynamicSerializers | back to summary |
|---|---|
| protected PropertySerializerMap _dynamicSerializers If | |
| _generator | back to summary |
|---|---|
| protected final JsonGenerator _generator | |
| _openArray | back to summary |
|---|---|
| protected boolean _openArray State flag for keeping track of need to write matching END_ARRAY, if a START_ARRAY was written during initialization | |
| _provider | back to summary |
|---|---|
| protected final DefaultSerializerProvider _provider | |
| _rootSerializer | back to summary |
|---|---|
| protected final JsonSerializer<Object> _rootSerializer | |
| _typeSerializer | back to summary |
|---|---|
| protected final TypeSerializer _typeSerializer | |
| SequenceWriter | back to summary |
|---|---|
| public SequenceWriter(DefaultSerializerProvider prov, JsonGenerator gen, boolean closeGenerator, ObjectWriter. | |
| _findAndAddDynamic | back to summary |
|---|---|
| private final JsonSerializer | |
| _findAndAddDynamic | back to summary |
|---|---|
| private final JsonSerializer | |
| _writeCloseableValue | back to summary |
|---|---|
| protected SequenceWriter _writeCloseableValue(Object value) throws IOException | |
| _writeCloseableValue | back to summary |
|---|---|
| protected SequenceWriter _writeCloseableValue(Object value, JavaType type) throws IOException | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements java. Doc from java. Flushes this stream by writing any buffered output to the underlying stream.
| |
| init | back to summary |
|---|---|
| public SequenceWriter init(boolean wrapInArray) throws IOException Internal method called by | |
| version | back to summary |
|---|---|
| public Version version() Implements com. Method that will return version information stored in and read from jar that contains this class.
| |
| write | back to summary |
|---|---|
| public SequenceWriter write(Object value) throws IOException Method for writing given value into output, as part of sequence
to write. If root type was specified for | |
| write | back to summary |
|---|---|
| public SequenceWriter write(Object value, JavaType type) throws IOException Method for writing given value into output, as part of sequence
to write; further, full type (often generic, like | |
| writeAll | back to summary |
|---|---|
| public SequenceWriter writeAll(Object[] value) throws IOException | |
| writeAll | back to summary |
|---|---|
| public <C extends Collection | |
| writeAll | back to summary |
|---|---|
public SequenceWriter writeAll(Iterable<?> iterable) throws IOException
| |