T
- Type of result being composed.public class JSONComposer<T> extends SequenceComposer<JSONComposer<T>>
JsonGenerator
object.
This is similar to ArrayComposer
, but does not
have parent composer (so no end()
method),
but does implement Closeable
Modifier and Type | Field and Description |
---|---|
protected ByteArrayBuilder |
_byteWriter |
protected boolean |
_closeGenerator |
protected int |
_features |
protected T |
_result |
protected SegmentedStringWriter |
_stringWriter |
_generator
_child, _open
Modifier | Constructor and Description |
---|---|
|
JSONComposer(int features,
JsonGenerator gen,
boolean closeGenerator) |
protected |
JSONComposer(int features,
JsonGenerator gen,
ByteArrayBuilder w) |
protected |
JSONComposer(int features,
JsonGenerator gen,
SegmentedStringWriter w) |
protected |
JSONComposer(int features,
T result) |
Modifier and Type | Method and Description |
---|---|
protected Object |
_finish() |
protected JSONComposer<T> |
_start() |
static JSONComposer<byte[]> |
bytesComposer(int features,
JsonGenerator gen,
ByteArrayBuilder w) |
static <T extends Collection<Object>> |
collectionComposer(int features,
T coll) |
T |
finish()
Method to call to complete composition, flush any pending content,
and return instance of specified result type.
|
static JSONComposer<Map<String,Object>> |
mapComposer(int features,
Map<String,Object> map) |
static <RESULT> JSONComposer<RESULT> |
streamComposer(int features,
JsonGenerator gen,
boolean closeGenerator) |
static JSONComposer<String> |
stringComposer(int features,
JsonGenerator gen,
SegmentedStringWriter w) |
_closeChild, _this, add, add, add, add, add, add, addNull, addObject, flush, startArray, startObject
_childClosed, _illegalCall, _safeFinish, _startArray, _startCollection, _startMap, _startObject
protected final int _features
protected final boolean _closeGenerator
protected T _result
protected SegmentedStringWriter _stringWriter
protected ByteArrayBuilder _byteWriter
public JSONComposer(int features, JsonGenerator gen, boolean closeGenerator)
protected JSONComposer(int features, JsonGenerator gen, SegmentedStringWriter w)
protected JSONComposer(int features, JsonGenerator gen, ByteArrayBuilder w)
protected JSONComposer(int features, T result)
public static <RESULT> JSONComposer<RESULT> streamComposer(int features, JsonGenerator gen, boolean closeGenerator)
public static JSONComposer<String> stringComposer(int features, JsonGenerator gen, SegmentedStringWriter w)
public static JSONComposer<byte[]> bytesComposer(int features, JsonGenerator gen, ByteArrayBuilder w)
public static <T extends Collection<Object>> JSONComposer<T> collectionComposer(int features, T coll)
public static JSONComposer<Map<String,Object>> mapComposer(int features, Map<String,Object> map)
public T finish() throws IOException
IOException
protected JSONComposer<T> _start() throws IOException
_start
in class ComposerBase
IOException
protected Object _finish() throws IOException
_finish
in class ComposerBase
IOException
Copyright © 2020 FasterXML. All rights reserved.