java.lang.Object
tools.jackson.core.JsonGenerator
tools.jackson.databind.node.TreeBuildingGenerator
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
,tools.jackson.core.Versioned
public class TreeBuildingGenerator
extends tools.jackson.core.JsonGenerator
Helper class used for creating
JsonNode
values directly
as part of serialization.- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JsonNodeFactory
protected final tools.jackson.core.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 tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamWriteCapability>
protected static final int
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
void
close()
tools.jackson.core.JsonGenerator
configure
(tools.jackson.core.StreamWriteFeature f, boolean state) void
flush()
static TreeBuildingGenerator
forSerialization
(SerializationContext ctxt, JsonNodeFactory nodeFactory) boolean
isClosed()
boolean
isEnabled
(tools.jackson.core.StreamWriteFeature f) tools.jackson.core.ObjectWriteContext
tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamWriteCapability>
tools.jackson.core.TokenStreamContext
int
int
tools.jackson.core.Version
version()
tools.jackson.core.JsonGenerator
writeBinary
(tools.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len) int
writeBinary
(tools.jackson.core.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.tools.jackson.core.JsonGenerator
writeBoolean
(boolean state) tools.jackson.core.JsonGenerator
writeEmbeddedObject
(Object object) tools.jackson.core.JsonGenerator
tools.jackson.core.JsonGenerator
tools.jackson.core.JsonGenerator
tools.jackson.core.JsonGenerator
writeName
(tools.jackson.core.SerializableString name) tools.jackson.core.JsonGenerator
tools.jackson.core.JsonGenerator
writeNumber
(double v) tools.jackson.core.JsonGenerator
writeNumber
(float v) tools.jackson.core.JsonGenerator
writeNumber
(int v) tools.jackson.core.JsonGenerator
writeNumber
(long v) tools.jackson.core.JsonGenerator
writeNumber
(short v) tools.jackson.core.JsonGenerator
writeNumber
(String encodedValue) tools.jackson.core.JsonGenerator
tools.jackson.core.JsonGenerator
tools.jackson.core.JsonGenerator
writeObjectId
(Object id) tools.jackson.core.JsonGenerator
tools.jackson.core.JsonGenerator
writePropertyId
(long id) tools.jackson.core.JsonGenerator
writeRaw
(char c) tools.jackson.core.JsonGenerator
writeRaw
(char[] text, int offset, int len) tools.jackson.core.JsonGenerator
tools.jackson.core.JsonGenerator
tools.jackson.core.JsonGenerator
writeRaw
(tools.jackson.core.SerializableString text) tools.jackson.core.JsonGenerator
writeRawUTF8String
(byte[] text, int offset, int length) tools.jackson.core.JsonGenerator
writeRawValue
(char[] text, int offset, int len) tools.jackson.core.JsonGenerator
writeRawValue
(String text) tools.jackson.core.JsonGenerator
writeRawValue
(String text, int offset, int len) tools.jackson.core.JsonGenerator
tools.jackson.core.JsonGenerator
writeStartArray
(Object forValue) tools.jackson.core.JsonGenerator
writeStartArray
(Object forValue, int len) tools.jackson.core.JsonGenerator
tools.jackson.core.JsonGenerator
writeStartObject
(Object forValue) tools.jackson.core.JsonGenerator
writeStartObject
(Object forValue, int size) tools.jackson.core.JsonGenerator
writeString
(char[] text, int offset, int len) tools.jackson.core.JsonGenerator
writeString
(Reader reader, int len) tools.jackson.core.JsonGenerator
writeString
(String text) tools.jackson.core.JsonGenerator
writeString
(tools.jackson.core.SerializableString text) tools.jackson.core.JsonGenerator
writeTree
(tools.jackson.core.TreeNode node) tools.jackson.core.JsonGenerator
writeTypeId
(Object id) tools.jackson.core.JsonGenerator
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
protected static final tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamWriteCapability> BOGUS_WRITE_CAPABILITIES -
_objectWriteContext
protected final tools.jackson.core.ObjectWriteContext _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
public tools.jackson.core.TokenStreamContext streamWriteContext()- Specified by:
streamWriteContext
in classtools.jackson.core.JsonGenerator
-
currentValue
- Specified by:
currentValue
in classtools.jackson.core.JsonGenerator
-
assignCurrentValue
- Specified by:
assignCurrentValue
in classtools.jackson.core.JsonGenerator
-
objectWriteContext
public tools.jackson.core.ObjectWriteContext objectWriteContext()- Specified by:
objectWriteContext
in classtools.jackson.core.JsonGenerator
-
version
public tools.jackson.core.Version version()- Specified by:
version
in interfacetools.jackson.core.Versioned
- Specified by:
version
in classtools.jackson.core.JsonGenerator
-
configure
public tools.jackson.core.JsonGenerator configure(tools.jackson.core.StreamWriteFeature f, boolean state) - Specified by:
configure
in classtools.jackson.core.JsonGenerator
-
isEnabled
public boolean isEnabled(tools.jackson.core.StreamWriteFeature f) - Specified by:
isEnabled
in classtools.jackson.core.JsonGenerator
-
streamWriteFeatures
public int streamWriteFeatures()- Specified by:
streamWriteFeatures
in classtools.jackson.core.JsonGenerator
-
streamWriteCapabilities
public tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamWriteCapability> streamWriteCapabilities()- Specified by:
streamWriteCapabilities
in classtools.jackson.core.JsonGenerator
-
flush
public void flush() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classtools.jackson.core.JsonGenerator
-
isClosed
public boolean isClosed()- Specified by:
isClosed
in classtools.jackson.core.JsonGenerator
-
streamWriteOutputTarget
- Specified by:
streamWriteOutputTarget
in classtools.jackson.core.JsonGenerator
-
streamWriteOutputBuffered
public int streamWriteOutputBuffered()- Specified by:
streamWriteOutputBuffered
in classtools.jackson.core.JsonGenerator
-
writeStartArray
public tools.jackson.core.JsonGenerator writeStartArray()- Specified by:
writeStartArray
in classtools.jackson.core.JsonGenerator
-
writeStartArray
- Specified by:
writeStartArray
in classtools.jackson.core.JsonGenerator
-
writeStartArray
- Specified by:
writeStartArray
in classtools.jackson.core.JsonGenerator
-
writeEndArray
public tools.jackson.core.JsonGenerator writeEndArray()- Specified by:
writeEndArray
in classtools.jackson.core.JsonGenerator
-
writeStartObject
public tools.jackson.core.JsonGenerator writeStartObject()- Specified by:
writeStartObject
in classtools.jackson.core.JsonGenerator
-
writeStartObject
- Specified by:
writeStartObject
in classtools.jackson.core.JsonGenerator
-
writeStartObject
- Specified by:
writeStartObject
in classtools.jackson.core.JsonGenerator
-
writeEndObject
public tools.jackson.core.JsonGenerator writeEndObject()- Specified by:
writeEndObject
in classtools.jackson.core.JsonGenerator
-
writeName
- Specified by:
writeName
in classtools.jackson.core.JsonGenerator
-
writeName
public tools.jackson.core.JsonGenerator writeName(tools.jackson.core.SerializableString name) - Specified by:
writeName
in classtools.jackson.core.JsonGenerator
-
writePropertyId
public tools.jackson.core.JsonGenerator writePropertyId(long id) - Specified by:
writePropertyId
in classtools.jackson.core.JsonGenerator
-
writeString
- Specified by:
writeString
in classtools.jackson.core.JsonGenerator
-
writeString
public tools.jackson.core.JsonGenerator writeString(char[] text, int offset, int len) - Specified by:
writeString
in classtools.jackson.core.JsonGenerator
-
writeString
public tools.jackson.core.JsonGenerator writeString(tools.jackson.core.SerializableString text) - Specified by:
writeString
in classtools.jackson.core.JsonGenerator
-
writeString
- Specified by:
writeString
in classtools.jackson.core.JsonGenerator
-
writeRawUTF8String
public tools.jackson.core.JsonGenerator writeRawUTF8String(byte[] text, int offset, int length) - Specified by:
writeRawUTF8String
in classtools.jackson.core.JsonGenerator
-
writeUTF8String
public tools.jackson.core.JsonGenerator writeUTF8String(byte[] text, int offset, int length) - Specified by:
writeUTF8String
in classtools.jackson.core.JsonGenerator
-
writeRaw
- Specified by:
writeRaw
in classtools.jackson.core.JsonGenerator
-
writeRaw
- Specified by:
writeRaw
in classtools.jackson.core.JsonGenerator
-
writeRaw
public tools.jackson.core.JsonGenerator writeRaw(tools.jackson.core.SerializableString text) - Overrides:
writeRaw
in classtools.jackson.core.JsonGenerator
-
writeRaw
public tools.jackson.core.JsonGenerator writeRaw(char[] text, int offset, int len) - Specified by:
writeRaw
in classtools.jackson.core.JsonGenerator
-
writeRaw
public tools.jackson.core.JsonGenerator writeRaw(char c) - Specified by:
writeRaw
in classtools.jackson.core.JsonGenerator
-
writeRawValue
- Specified by:
writeRawValue
in classtools.jackson.core.JsonGenerator
-
writeRawValue
- Specified by:
writeRawValue
in classtools.jackson.core.JsonGenerator
-
writeRawValue
public tools.jackson.core.JsonGenerator writeRawValue(char[] text, int offset, int len) - Specified by:
writeRawValue
in classtools.jackson.core.JsonGenerator
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(short v) - Specified by:
writeNumber
in classtools.jackson.core.JsonGenerator
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(int v) - Specified by:
writeNumber
in classtools.jackson.core.JsonGenerator
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(long v) - Specified by:
writeNumber
in classtools.jackson.core.JsonGenerator
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(double v) - Specified by:
writeNumber
in classtools.jackson.core.JsonGenerator
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(float v) - Specified by:
writeNumber
in classtools.jackson.core.JsonGenerator
-
writeNumber
- Specified by:
writeNumber
in classtools.jackson.core.JsonGenerator
-
writeNumber
- Specified by:
writeNumber
in classtools.jackson.core.JsonGenerator
-
writeNumber
- Specified by:
writeNumber
in classtools.jackson.core.JsonGenerator
-
writeBoolean
public tools.jackson.core.JsonGenerator writeBoolean(boolean state) - Specified by:
writeBoolean
in classtools.jackson.core.JsonGenerator
-
writeNull
public tools.jackson.core.JsonGenerator writeNull()- Specified by:
writeNull
in classtools.jackson.core.JsonGenerator
-
writePOJO
- Specified by:
writePOJO
in classtools.jackson.core.JsonGenerator
-
writeTree
public tools.jackson.core.JsonGenerator writeTree(tools.jackson.core.TreeNode node) - Specified by:
writeTree
in classtools.jackson.core.JsonGenerator
-
writeBinary
public tools.jackson.core.JsonGenerator writeBinary(tools.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len) - Specified by:
writeBinary
in classtools.jackson.core.JsonGenerator
-
writeBinary
public int writeBinary(tools.jackson.core.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. Because of this, currently this will simply throwUnsupportedOperationException
- Specified by:
writeBinary
in classtools.jackson.core.JsonGenerator
-
canWriteTypeId
public boolean canWriteTypeId()- Overrides:
canWriteTypeId
in classtools.jackson.core.JsonGenerator
-
canWriteObjectId
public boolean canWriteObjectId()- Overrides:
canWriteObjectId
in classtools.jackson.core.JsonGenerator
-
writeTypeId
- Overrides:
writeTypeId
in classtools.jackson.core.JsonGenerator
-
writeObjectId
- Overrides:
writeObjectId
in classtools.jackson.core.JsonGenerator
-
writeEmbeddedObject
- Overrides:
writeEmbeddedObject
in classtools.jackson.core.JsonGenerator
-