Top Description Fields Constructors Methods
tools.jackson.jr.ob

public Class JSONComposer<T>

extends SequenceComposer<JSONComposer<T>>
Class Inheritance
Type Parameters
<T>
Type of result being composed.
Imports
java.util.*, tools.jackson.core.JsonGenerator, tools.jackson.core.io.SegmentedStringWriter, tools.jackson.core.util.ByteArrayBuilder, tools.jackson.jr.ob.JSON.Feature, tools.jackson.jr.ob.comp.SequenceComposer

Root-level composer object that acts as streaming "builder" object, using an underlying tools.jackson.core.JsonGenerator object. This is similar to tools.jackson.jr.ob.comp.ArrayComposer, but does not have parent composer (so no end() method), but does implement java.io.Closeable

Field Summary

Modifier and TypeField and Description
protected ByteArrayBuilder
protected final boolean
protected final int
protected T
protected SegmentedStringWriter
Inherited from tools.jackson.jr.ob.comp.SequenceComposer:
_generator

Constructor Summary

AccessConstructor and Description
public
JSONComposer(int features, JsonGenerator gen, boolean closeGenerator)

protected
protected
protected
JSONComposer(int features, T result)

Method Summary

Modifier and TypeMethod and Description
protected Object
protected JSONComposer<T>
public static JSONComposer<byte[]>
public static <T extends Collection<Object>> JSONComposer<T>
collectionComposer(int features, T coll)

public T
finish()

Method to call to complete composition, flush any pending content, and return instance of specified result type.

public static JSONComposer<Map<String, Object>>
mapComposer(int features, Map<String, Object> map)

public static <RESULT> JSONComposer<RESULT>
streamComposer(int features, JsonGenerator gen, boolean closeGenerator)

public static JSONComposer<String>
Inherited from tools.jackson.jr.ob.comp.SequenceComposer:
_closeChild_thisaddaddaddaddaddaddaddNulladdPOJOflushstartArraystartObject

Field Detail

_byteWriterback to summary
protected ByteArrayBuilder _byteWriter
_closeGeneratorback to summary
protected final boolean _closeGenerator
_featuresback to summary
protected final int _features
_resultback to summary
protected T _result
_stringWriterback to summary
protected SegmentedStringWriter _stringWriter

Constructor Detail

JSONComposerback to summary
public JSONComposer(int features, JsonGenerator gen, boolean closeGenerator)
JSONComposerback to summary
protected JSONComposer(int features, JsonGenerator gen, SegmentedStringWriter w)
JSONComposerback to summary
protected JSONComposer(int features, JsonGenerator gen, ByteArrayBuilder w)
JSONComposerback to summary
protected JSONComposer(int features, T result)

Method Detail

_finishback to summary
protected Object _finish()

Implements abstract tools.jackson.jr.ob.comp.ComposerBase._finish.

Annotations
@Override
_startback to summary
protected JSONComposer<T> _start()

Implements abstract tools.jackson.jr.ob.comp.ComposerBase._start.

Annotations
@Override
bytesComposerback to summary
public static JSONComposer<byte[]> bytesComposer(int features, JsonGenerator gen, ByteArrayBuilder w)
collectionComposerback to summary
public static <T extends Collection<Object>> JSONComposer<T> collectionComposer(int features, T coll)
finishback to summary
public T finish()

Method to call to complete composition, flush any pending content, and return instance of specified result type.

Annotations
@SuppressWarnings:unchecked
mapComposerback to summary
public static JSONComposer<Map<String, Object>> mapComposer(int features, Map<String, Object> map)
streamComposerback to summary
public static <RESULT> JSONComposer<RESULT> streamComposer(int features, JsonGenerator gen, boolean closeGenerator)
stringComposerback to summary
public static JSONComposer<String> stringComposer(int features, JsonGenerator gen, SegmentedStringWriter w)