Class TreeBuildingGenerator

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

    Fields
    Modifier and Type
    Field
    Description
    protected 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 which StreamWriteFeatures 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 Type
    Method
    Description
    void
     
    boolean
     
    boolean
     
    void
     
    tools.jackson.core.JsonGenerator
    configure(tools.jackson.core.StreamWriteFeature f, boolean state)
     
     
    void
     
     
    boolean
     
    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
     
    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
     
    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
     
    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
    writeRaw(String text, int offset, int len)
     
    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
     
    tools.jackson.core.JsonGenerator
    writeRawValue(String text, int offset, int len)
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
    writeStartArray(Object forValue, int len)
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
     
    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
     
    tools.jackson.core.JsonGenerator
    writeString(tools.jackson.core.SerializableString text)
     
    tools.jackson.core.JsonGenerator
    writeTree(tools.jackson.core.TreeNode node)
     
    tools.jackson.core.JsonGenerator
     
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      protected final JsonNodeFactory _nodeFactory
    • _streamWriteFeatures

      protected final int _streamWriteFeatures
      Bit flag composed of bits that indicate which StreamWriteFeatures 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

      public JsonNode treeBuilt()
    • streamWriteContext

      public tools.jackson.core.TokenStreamContext streamWriteContext()
      Specified by:
      streamWriteContext in class tools.jackson.core.JsonGenerator
    • currentValue

      public Object currentValue()
      Specified by:
      currentValue in class tools.jackson.core.JsonGenerator
    • assignCurrentValue

      public void assignCurrentValue(Object v)
      Specified by:
      assignCurrentValue in class tools.jackson.core.JsonGenerator
    • objectWriteContext

      public tools.jackson.core.ObjectWriteContext objectWriteContext()
      Specified by:
      objectWriteContext in class tools.jackson.core.JsonGenerator
    • version

      public tools.jackson.core.Version version()
      Specified by:
      version in interface tools.jackson.core.Versioned
      Specified by:
      version in class tools.jackson.core.JsonGenerator
    • configure

      public tools.jackson.core.JsonGenerator configure(tools.jackson.core.StreamWriteFeature f, boolean state)
      Specified by:
      configure in class tools.jackson.core.JsonGenerator
    • isEnabled

      public boolean isEnabled(tools.jackson.core.StreamWriteFeature f)
      Specified by:
      isEnabled in class tools.jackson.core.JsonGenerator
    • streamWriteFeatures

      public int streamWriteFeatures()
      Specified by:
      streamWriteFeatures in class tools.jackson.core.JsonGenerator
    • streamWriteCapabilities

      public tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamWriteCapability> streamWriteCapabilities()
      Specified by:
      streamWriteCapabilities in class tools.jackson.core.JsonGenerator
    • flush

      public void flush()
      Specified by:
      flush in interface Flushable
      Specified by:
      flush in class tools.jackson.core.JsonGenerator
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class tools.jackson.core.JsonGenerator
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in class tools.jackson.core.JsonGenerator
    • streamWriteOutputTarget

      public Object streamWriteOutputTarget()
      Specified by:
      streamWriteOutputTarget in class tools.jackson.core.JsonGenerator
    • streamWriteOutputBuffered

      public int streamWriteOutputBuffered()
      Specified by:
      streamWriteOutputBuffered in class tools.jackson.core.JsonGenerator
    • writeStartArray

      public tools.jackson.core.JsonGenerator writeStartArray()
      Specified by:
      writeStartArray in class tools.jackson.core.JsonGenerator
    • writeStartArray

      public tools.jackson.core.JsonGenerator writeStartArray(Object forValue)
      Specified by:
      writeStartArray in class tools.jackson.core.JsonGenerator
    • writeStartArray

      public tools.jackson.core.JsonGenerator writeStartArray(Object forValue, int len)
      Specified by:
      writeStartArray in class tools.jackson.core.JsonGenerator
    • writeEndArray

      public tools.jackson.core.JsonGenerator writeEndArray()
      Specified by:
      writeEndArray in class tools.jackson.core.JsonGenerator
    • writeStartObject

      public tools.jackson.core.JsonGenerator writeStartObject()
      Specified by:
      writeStartObject in class tools.jackson.core.JsonGenerator
    • writeStartObject

      public tools.jackson.core.JsonGenerator writeStartObject(Object forValue)
      Specified by:
      writeStartObject in class tools.jackson.core.JsonGenerator
    • writeStartObject

      public tools.jackson.core.JsonGenerator writeStartObject(Object forValue, int size)
      Specified by:
      writeStartObject in class tools.jackson.core.JsonGenerator
    • writeEndObject

      public tools.jackson.core.JsonGenerator writeEndObject()
      Specified by:
      writeEndObject in class tools.jackson.core.JsonGenerator
    • writeName

      public tools.jackson.core.JsonGenerator writeName(String name)
      Specified by:
      writeName in class tools.jackson.core.JsonGenerator
    • writeName

      public tools.jackson.core.JsonGenerator writeName(tools.jackson.core.SerializableString name)
      Specified by:
      writeName in class tools.jackson.core.JsonGenerator
    • writePropertyId

      public tools.jackson.core.JsonGenerator writePropertyId(long id)
      Specified by:
      writePropertyId in class tools.jackson.core.JsonGenerator
    • writeString

      public tools.jackson.core.JsonGenerator writeString(String text)
      Specified by:
      writeString in class tools.jackson.core.JsonGenerator
    • writeString

      public tools.jackson.core.JsonGenerator writeString(char[] text, int offset, int len)
      Specified by:
      writeString in class tools.jackson.core.JsonGenerator
    • writeString

      public tools.jackson.core.JsonGenerator writeString(tools.jackson.core.SerializableString text)
      Specified by:
      writeString in class tools.jackson.core.JsonGenerator
    • writeString

      public tools.jackson.core.JsonGenerator writeString(Reader reader, int len)
      Specified by:
      writeString in class tools.jackson.core.JsonGenerator
    • writeRawUTF8String

      public tools.jackson.core.JsonGenerator writeRawUTF8String(byte[] text, int offset, int length)
      Specified by:
      writeRawUTF8String in class tools.jackson.core.JsonGenerator
    • writeUTF8String

      public tools.jackson.core.JsonGenerator writeUTF8String(byte[] text, int offset, int length)
      Specified by:
      writeUTF8String in class tools.jackson.core.JsonGenerator
    • writeRaw

      public tools.jackson.core.JsonGenerator writeRaw(String text)
      Specified by:
      writeRaw in class tools.jackson.core.JsonGenerator
    • writeRaw

      public tools.jackson.core.JsonGenerator writeRaw(String text, int offset, int len)
      Specified by:
      writeRaw in class tools.jackson.core.JsonGenerator
    • writeRaw

      public tools.jackson.core.JsonGenerator writeRaw(tools.jackson.core.SerializableString text)
      Overrides:
      writeRaw in class tools.jackson.core.JsonGenerator
    • writeRaw

      public tools.jackson.core.JsonGenerator writeRaw(char[] text, int offset, int len)
      Specified by:
      writeRaw in class tools.jackson.core.JsonGenerator
    • writeRaw

      public tools.jackson.core.JsonGenerator writeRaw(char c)
      Specified by:
      writeRaw in class tools.jackson.core.JsonGenerator
    • writeRawValue

      public tools.jackson.core.JsonGenerator writeRawValue(String text)
      Specified by:
      writeRawValue in class tools.jackson.core.JsonGenerator
    • writeRawValue

      public tools.jackson.core.JsonGenerator writeRawValue(String text, int offset, int len)
      Specified by:
      writeRawValue in class tools.jackson.core.JsonGenerator
    • writeRawValue

      public tools.jackson.core.JsonGenerator writeRawValue(char[] text, int offset, int len)
      Specified by:
      writeRawValue in class tools.jackson.core.JsonGenerator
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(short v)
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(int v)
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(long v)
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(double v)
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(float v)
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(BigDecimal v)
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(BigInteger v)
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(String encodedValue)
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
    • writeBoolean

      public tools.jackson.core.JsonGenerator writeBoolean(boolean state)
      Specified by:
      writeBoolean in class tools.jackson.core.JsonGenerator
    • writeNull

      public tools.jackson.core.JsonGenerator writeNull()
      Specified by:
      writeNull in class tools.jackson.core.JsonGenerator
    • writePOJO

      public tools.jackson.core.JsonGenerator writePOJO(Object value)
      Specified by:
      writePOJO in class tools.jackson.core.JsonGenerator
    • writeTree

      public tools.jackson.core.JsonGenerator writeTree(tools.jackson.core.TreeNode node)
      Specified by:
      writeTree in class tools.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 class tools.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 throw UnsupportedOperationException
      Specified by:
      writeBinary in class tools.jackson.core.JsonGenerator
    • canWriteTypeId

      public boolean canWriteTypeId()
      Overrides:
      canWriteTypeId in class tools.jackson.core.JsonGenerator
    • canWriteObjectId

      public boolean canWriteObjectId()
      Overrides:
      canWriteObjectId in class tools.jackson.core.JsonGenerator
    • writeTypeId

      public tools.jackson.core.JsonGenerator writeTypeId(Object id)
      Overrides:
      writeTypeId in class tools.jackson.core.JsonGenerator
    • writeObjectId

      public tools.jackson.core.JsonGenerator writeObjectId(Object id)
      Overrides:
      writeObjectId in class tools.jackson.core.JsonGenerator
    • writeEmbeddedObject

      public tools.jackson.core.JsonGenerator writeEmbeddedObject(Object object)
      Overrides:
      writeEmbeddedObject in class tools.jackson.core.JsonGenerator