Package com.fasterxml.jackson.jr.ob.comp
Class ObjectComposer<PARENT extends ComposerBase>
- java.lang.Object
-
- com.fasterxml.jackson.jr.ob.comp.ComposerBase
-
- com.fasterxml.jackson.jr.ob.comp.ObjectComposer<PARENT>
-
- All Implemented Interfaces:
Flushable
public class ObjectComposer<PARENT extends ComposerBase> extends ComposerBase
-
-
Field Summary
Fields Modifier and Type Field Description protected com.fasterxml.jackson.core.JsonGenerator
_generator
protected PARENT
_parent
-
Fields inherited from class com.fasterxml.jackson.jr.ob.comp.ComposerBase
_child, _open
-
-
Constructor Summary
Constructors Constructor Description ObjectComposer(PARENT parent, com.fasterxml.jackson.core.JsonGenerator g)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_closeChild()
protected Object
_finish()
protected ObjectComposer<PARENT>
_start()
PARENT
end()
void
flush()
ObjectComposer<PARENT>
put(String fieldName, boolean value)
ObjectComposer<PARENT>
put(String fieldName, double value)
ObjectComposer<PARENT>
put(String fieldName, int value)
ObjectComposer<PARENT>
put(String fieldName, long value)
ObjectComposer<PARENT>
put(String fieldName, CharSequence value)
ObjectComposer<PARENT>
put(String fieldName, String value)
ObjectComposer<PARENT>
putNull(String fieldName)
ObjectComposer<PARENT>
putObject(String fieldName, Object value)
Method used to put a Java Object ("POJO") value into Object being composed: this requires that the underlyingJsonGenerator
has a properly configuredObjectCodec
to use for serializer object.ArrayComposer<ObjectComposer<PARENT>>
startArrayField(com.fasterxml.jackson.core.SerializableString fieldName)
ArrayComposer<ObjectComposer<PARENT>>
startArrayField(String fieldName)
ObjectComposer<ObjectComposer<PARENT>>
startObjectField(com.fasterxml.jackson.core.SerializableString fieldName)
ObjectComposer<ObjectComposer<PARENT>>
startObjectField(String fieldName)
-
Methods inherited from class com.fasterxml.jackson.jr.ob.comp.ComposerBase
_childClosed, _illegalCall, _safeFinish, _startArray, _startCollection, _startMap, _startObject
-
-
-
-
Field Detail
-
_parent
protected final PARENT extends ComposerBase _parent
-
_generator
protected final com.fasterxml.jackson.core.JsonGenerator _generator
-
-
Constructor Detail
-
ObjectComposer
public ObjectComposer(PARENT parent, com.fasterxml.jackson.core.JsonGenerator g)
-
-
Method Detail
-
flush
public void flush() throws IOException
- Throws:
IOException
-
_start
protected ObjectComposer<PARENT> _start() throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Specified by:
_start
in classComposerBase
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
_finish
protected Object _finish() throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Specified by:
_finish
in classComposerBase
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
startArrayField
public ArrayComposer<ObjectComposer<PARENT>> startArrayField(String fieldName) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
startArrayField
public ArrayComposer<ObjectComposer<PARENT>> startArrayField(com.fasterxml.jackson.core.SerializableString fieldName) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
startObjectField
public ObjectComposer<ObjectComposer<PARENT>> startObjectField(String fieldName) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
startObjectField
public ObjectComposer<ObjectComposer<PARENT>> startObjectField(com.fasterxml.jackson.core.SerializableString fieldName) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
end
public PARENT end() throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
put
public ObjectComposer<PARENT> put(String fieldName, boolean value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
putNull
public ObjectComposer<PARENT> putNull(String fieldName) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
putObject
public ObjectComposer<PARENT> putObject(String fieldName, Object value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
Method used to put a Java Object ("POJO") value into Object being composed: this requires that the underlyingJsonGenerator
has a properly configuredObjectCodec
to use for serializer object.- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
- Since:
- 2.6
-
put
public ObjectComposer<PARENT> put(String fieldName, int value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
put
public ObjectComposer<PARENT> put(String fieldName, long value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
put
public ObjectComposer<PARENT> put(String fieldName, double value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
put
public ObjectComposer<PARENT> put(String fieldName, String value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
put
public ObjectComposer<PARENT> put(String fieldName, CharSequence value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
_closeChild
protected void _closeChild() throws IOException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
IOException
com.fasterxml.jackson.core.JsonProcessingException
-
-