Package com.fasterxml.jackson.jr.ob
Class JSONComposer<T>
java.lang.Object
com.fasterxml.jackson.jr.ob.comp.ComposerBase
com.fasterxml.jackson.jr.ob.comp.SequenceComposer<JSONComposer<T>>
com.fasterxml.jackson.jr.ob.JSONComposer<T>
- Type Parameters:
T- Type of result being composed.
- All Implemented Interfaces:
Flushable
Root-level composer object that acts as streaming "builder"
object, using an underlying
JsonGenerator object.
This is similar to ArrayComposer, but does not
have parent composer (so no end() method),
but does implement Closeable-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.fasterxml.jackson.core.util.ByteArrayBuilderprotected final booleanprotected final intprotected Tprotected com.fasterxml.jackson.core.io.SegmentedStringWriterFields inherited from class com.fasterxml.jackson.jr.ob.comp.SequenceComposer
_generatorFields inherited from class com.fasterxml.jackson.jr.ob.comp.ComposerBase
_child, _open -
Constructor Summary
ConstructorsModifierConstructorDescriptionJSONComposer(int features, com.fasterxml.jackson.core.JsonGenerator gen, boolean closeGenerator) protectedJSONComposer(int features, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.core.io.SegmentedStringWriter w) protectedJSONComposer(int features, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.core.util.ByteArrayBuilder w) protectedJSONComposer(int features, T result) -
Method Summary
Modifier and TypeMethodDescriptionprotected Object_finish()protected JSONComposer<T>_start()static JSONComposer<byte[]>bytesComposer(int features, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.core.util.ByteArrayBuilder w) static <T extends Collection<Object>>
JSONComposer<T>collectionComposer(int features, T coll) 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, com.fasterxml.jackson.core.JsonGenerator gen, boolean closeGenerator) static JSONComposer<String>stringComposer(int features, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.core.io.SegmentedStringWriter w) Methods inherited from class com.fasterxml.jackson.jr.ob.comp.SequenceComposer
_closeChild, _this, add, add, add, add, add, add, addNull, addObject, flush, startArray, startObjectMethods inherited from class com.fasterxml.jackson.jr.ob.comp.ComposerBase
_childClosed, _illegalCall, _safeFinish, _startArray, _startCollection, _startMap, _startObject
-
Field Details
-
_features
protected final int _features -
_closeGenerator
protected final boolean _closeGenerator -
_result
-
_stringWriter
protected com.fasterxml.jackson.core.io.SegmentedStringWriter _stringWriter -
_byteWriter
protected com.fasterxml.jackson.core.util.ByteArrayBuilder _byteWriter
-
-
Constructor Details
-
JSONComposer
public JSONComposer(int features, com.fasterxml.jackson.core.JsonGenerator gen, boolean closeGenerator) -
JSONComposer
protected JSONComposer(int features, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.core.io.SegmentedStringWriter w) -
JSONComposer
protected JSONComposer(int features, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.core.util.ByteArrayBuilder w) -
JSONComposer
-
-
Method Details
-
streamComposer
public static <RESULT> JSONComposer<RESULT> streamComposer(int features, com.fasterxml.jackson.core.JsonGenerator gen, boolean closeGenerator) -
stringComposer
public static JSONComposer<String> stringComposer(int features, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.core.io.SegmentedStringWriter w) -
bytesComposer
public static JSONComposer<byte[]> bytesComposer(int features, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.core.util.ByteArrayBuilder w) -
collectionComposer
public static <T extends Collection<Object>> JSONComposer<T> collectionComposer(int features, T coll) -
mapComposer
-
finish
Method to call to complete composition, flush any pending content, and return instance of specified result type.- Throws:
IOException
-
_start
- Specified by:
_startin classComposerBase- Throws:
IOException
-
_finish
- Specified by:
_finishin classComposerBase- Throws:
IOException
-