java.lang.Object
tools.jackson.core.JsonGenerator
tools.jackson.databind.node.TreeBuildingGenerator
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
,Versioned
Helper class used for creating
JsonNode
values directly
as part of serialization.- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JsonNodeFactory
protected final ObjectWriteContext
protected tools.jackson.databind.node.TreeBuildingGenerator.RootContext
protected final int
Bit flag composed of bits that indicate whichStreamWriteFeature
s are enabled.protected tools.jackson.databind.node.TreeBuildingGenerator.TreeWriteContext
protected static final JacksonFeatureSet<StreamWriteCapability>
protected static final int
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
void
close()
configure
(StreamWriteFeature f, boolean state) void
flush()
static TreeBuildingGenerator
forSerialization
(SerializationContext ctxt, JsonNodeFactory nodeFactory) boolean
isClosed()
boolean
int
int
version()
writeBinary
(Base64Variant b64variant, byte[] data, int offset, int len) int
writeBinary
(Base64Variant b64variant, InputStream data, int dataLength) Although we could support this method, it does not necessarily make sense: we cannot make good use of streaming because buffer must hold all the data.writeBoolean
(boolean state) writeEmbeddedObject
(Object object) writeName
(SerializableString name) writeNumber
(double v) writeNumber
(float v) writeNumber
(int v) writeNumber
(long v) writeNumber
(short v) writeNumber
(String encodedValue) writeObjectId
(Object id) writePropertyId
(long id) writeRaw
(char c) writeRaw
(char[] text, int offset, int len) writeRaw
(SerializableString text) writeRawUTF8String
(byte[] text, int offset, int length) writeRawValue
(char[] text, int offset, int len) writeRawValue
(String text) writeRawValue
(String text, int offset, int len) writeStartArray
(Object forValue) writeStartArray
(Object forValue, int len) writeStartObject
(Object forValue) writeStartObject
(Object forValue, int size) writeString
(char[] text, int offset, int len) writeString
(Reader reader, int len) writeString
(String text) writeTypeId
(Object id) writeUTF8String
(byte[] text, int offset, int length) Methods inherited from class tools.jackson.core.JsonGenerator
_constructWriteException, _constructWriteException, _constructWriteException, _constructWriteException, _copyCurrentContents, _copyCurrentFloatValue, _copyCurrentFloatValueExact, _copyCurrentIntValue, _copyCurrentStringValue, _reportArgumentError, _reportError, _reportUnsupportedOperation, _reportUnsupportedOperation, _verifyOffsets, _wrapIOFailure, _writeTypePrefixUsingNative, _writeTypePrefixUsingWrapper, canOmitProperties, copyCurrentEvent, copyCurrentEventExact, copyCurrentStructure, getCharacterEscapes, getHighestNonEscapedChar, getSchema, setCharacterEscapes, streamWriteConstraints, writeArray, writeArray, writeArray, writeArray, writeArrayPropertyStart, writeBinary, writeBinary, writeBinary, writeBinaryProperty, writeBooleanProperty, writeNullProperty, writeNumber, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeObjectPropertyStart, writeObjectRef, writeOmittedProperty, writePOJOProperty, writeRawValue, writeStringProperty, writeTypePrefix, writeTypeSuffix
-
Field Details
-
DEFAULT_STREAM_WRITE_FEATURES
protected static final int DEFAULT_STREAM_WRITE_FEATURES -
BOGUS_WRITE_CAPABILITIES
-
_objectWriteContext
-
_nodeFactory
-
_streamWriteFeatures
protected final int _streamWriteFeaturesBit flag composed of bits that indicate whichStreamWriteFeature
s are enabled.NOTE: most features have no effect on this class
-
_rootWriteContext
protected tools.jackson.databind.node.TreeBuildingGenerator.RootContext _rootWriteContext -
_tokenWriteContext
protected tools.jackson.databind.node.TreeBuildingGenerator.TreeWriteContext _tokenWriteContext
-
-
Method Details
-
forSerialization
public static TreeBuildingGenerator forSerialization(SerializationContext ctxt, JsonNodeFactory nodeFactory) -
treeBuilt
-
streamWriteContext
- Specified by:
streamWriteContext
in classJsonGenerator
-
currentValue
- Specified by:
currentValue
in classJsonGenerator
-
assignCurrentValue
- Specified by:
assignCurrentValue
in classJsonGenerator
-
objectWriteContext
- Specified by:
objectWriteContext
in classJsonGenerator
-
version
- Specified by:
version
in interfaceVersioned
- Specified by:
version
in classJsonGenerator
-
configure
- Specified by:
configure
in classJsonGenerator
-
isEnabled
- Specified by:
isEnabled
in classJsonGenerator
-
streamWriteFeatures
public int streamWriteFeatures()- Specified by:
streamWriteFeatures
in classJsonGenerator
-
streamWriteCapabilities
- Specified by:
streamWriteCapabilities
in classJsonGenerator
-
flush
public void flush()- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classJsonGenerator
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classJsonGenerator
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in classJsonGenerator
-
streamWriteOutputTarget
- Specified by:
streamWriteOutputTarget
in classJsonGenerator
-
streamWriteOutputBuffered
public int streamWriteOutputBuffered()- Specified by:
streamWriteOutputBuffered
in classJsonGenerator
-
writeStartArray
- Specified by:
writeStartArray
in classJsonGenerator
-
writeStartArray
- Specified by:
writeStartArray
in classJsonGenerator
-
writeStartArray
- Specified by:
writeStartArray
in classJsonGenerator
-
writeEndArray
- Specified by:
writeEndArray
in classJsonGenerator
-
writeStartObject
- Specified by:
writeStartObject
in classJsonGenerator
-
writeStartObject
- Specified by:
writeStartObject
in classJsonGenerator
-
writeStartObject
- Specified by:
writeStartObject
in classJsonGenerator
-
writeEndObject
- Specified by:
writeEndObject
in classJsonGenerator
-
writeName
- Specified by:
writeName
in classJsonGenerator
-
writeName
- Specified by:
writeName
in classJsonGenerator
-
writePropertyId
- Specified by:
writePropertyId
in classJsonGenerator
-
writeString
- Specified by:
writeString
in classJsonGenerator
-
writeString
- Specified by:
writeString
in classJsonGenerator
-
writeString
- Specified by:
writeString
in classJsonGenerator
-
writeString
- Specified by:
writeString
in classJsonGenerator
-
writeRawUTF8String
- Specified by:
writeRawUTF8String
in classJsonGenerator
-
writeUTF8String
- Specified by:
writeUTF8String
in classJsonGenerator
-
writeRaw
- Specified by:
writeRaw
in classJsonGenerator
-
writeRaw
- Specified by:
writeRaw
in classJsonGenerator
-
writeRaw
- Overrides:
writeRaw
in classJsonGenerator
-
writeRaw
- Specified by:
writeRaw
in classJsonGenerator
-
writeRaw
- Specified by:
writeRaw
in classJsonGenerator
-
writeRawValue
- Specified by:
writeRawValue
in classJsonGenerator
-
writeRawValue
- Specified by:
writeRawValue
in classJsonGenerator
-
writeRawValue
- Specified by:
writeRawValue
in classJsonGenerator
-
writeNumber
- Specified by:
writeNumber
in classJsonGenerator
-
writeNumber
- Specified by:
writeNumber
in classJsonGenerator
-
writeNumber
- Specified by:
writeNumber
in classJsonGenerator
-
writeNumber
- Specified by:
writeNumber
in classJsonGenerator
-
writeNumber
- Specified by:
writeNumber
in classJsonGenerator
-
writeNumber
- Specified by:
writeNumber
in classJsonGenerator
-
writeNumber
- Specified by:
writeNumber
in classJsonGenerator
-
writeNumber
- Specified by:
writeNumber
in classJsonGenerator
-
writeBoolean
- Specified by:
writeBoolean
in classJsonGenerator
-
writeNull
- Specified by:
writeNull
in classJsonGenerator
-
writePOJO
- Specified by:
writePOJO
in classJsonGenerator
-
writeTree
- Specified by:
writeTree
in classJsonGenerator
-
writeBinary
- Specified by:
writeBinary
in classJsonGenerator
-
writeBinary
Although we could support this method, it does not necessarily make sense: we cannot make good use of streaming because buffer must hold all the data. Because of this, currently this will simply throwUnsupportedOperationException
- Specified by:
writeBinary
in classJsonGenerator
-
canWriteTypeId
public boolean canWriteTypeId()- Overrides:
canWriteTypeId
in classJsonGenerator
-
canWriteObjectId
public boolean canWriteObjectId()- Overrides:
canWriteObjectId
in classJsonGenerator
-
writeTypeId
- Overrides:
writeTypeId
in classJsonGenerator
-
writeObjectId
- Overrides:
writeObjectId
in classJsonGenerator
-
writeEmbeddedObject
- Overrides:
writeEmbeddedObject
in classJsonGenerator
-