Class YAMLGenerator

java.lang.Object
tools.jackson.core.JsonGenerator
tools.jackson.core.base.GeneratorBase
tools.jackson.dataformat.yaml.YAMLGenerator
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, tools.jackson.core.Versioned

public class YAMLGenerator extends tools.jackson.core.base.GeneratorBase
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final boolean
     
    protected final org.snakeyaml.engine.v2.common.SpecVersion
     
    protected org.snakeyaml.engine.v2.emitter.Emitter
     
    protected int
    Bit flag composed of bits that indicate which YAMLWriteFeatures are enabled.
    protected String
    YAML supports native Object identifiers, so databinder may indicate need to output one.
    protected org.snakeyaml.engine.v2.api.DumpSettings
     
    protected final StringQuotingChecker
     
    protected int
     
    protected tools.jackson.core.util.SimpleStreamWriteContext
     
    protected String
    YAML supports native Type identifiers, so databinder may indicate need to output one.
    protected Writer
     
    protected static final long
     
    protected static final long
     
    protected static final Pattern
     
    protected static final String
     

    Fields inherited from class tools.jackson.core.base.GeneratorBase

    _closed, _ioContext, _objectWriteContext, _streamWriteConstraints, _streamWriteFeatures, DEFAULT_BINARY_WRITE_CAPABILITIES, DEFAULT_TEXTUAL_WRITE_CAPABILITIES, DEFAULT_WRITE_CAPABILITIES, MAX_BIG_DECIMAL_SCALE, SURR1_FIRST, SURR1_LAST, SURR2_FIRST, SURR2_LAST, WRITE_BINARY, WRITE_BOOLEAN, WRITE_NULL, WRITE_NUMBER, WRITE_RAW, WRITE_STRING
  • Constructor Summary

    Constructors
    Constructor
    Description
    YAMLGenerator(tools.jackson.core.ObjectWriteContext writeContext, tools.jackson.core.io.IOContext ioCtxt, int streamWriteFeatures, int yamlFeatures, StringQuotingChecker quotingChecker, Writer out, org.snakeyaml.engine.v2.common.SpecVersion version, org.snakeyaml.engine.v2.api.DumpSettings dumpOptions)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected final void
    _emit(org.snakeyaml.engine.v2.events.Event e)
     
    protected void
     
    protected void
     
    protected String
    _lf()
     
    protected void
     
    protected org.snakeyaml.engine.v2.events.ScalarEvent
    _scalarEvent(String value, org.snakeyaml.engine.v2.common.ScalarStyle style)
     
    protected final void
     
    protected void
    _writeScalar(String value, String type, org.snakeyaml.engine.v2.common.ScalarStyle style)
     
    final void
     
    protected org.snakeyaml.engine.v2.api.DumpSettings
    buildDumperOptions(int streamWriteFeatures, int yamlFeatures, org.snakeyaml.engine.v2.common.SpecVersion version)
     
    boolean
     
    boolean
     
    void
     
    final Object
     
    final void
     
    tools.jackson.core.PrettyPrinter
     
    final boolean
     
    tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamWriteCapability>
     
    final tools.jackson.core.TokenStreamContext
     
    int
    SnakeYAML does not expose buffered content amount, so we can only return -1 from here
     
    tools.jackson.core.Version
     
    tools.jackson.core.JsonGenerator
    writeBinary(tools.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len)
     
    tools.jackson.core.JsonGenerator
    writeBoolean(boolean state)
     
    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 d)
     
    tools.jackson.core.JsonGenerator
    writeNumber(float f)
     
    tools.jackson.core.JsonGenerator
    writeNumber(int v)
     
    tools.jackson.core.JsonGenerator
    writeNumber(long l)
     
    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
    writeRawUTF8String(byte[] text, int offset, int len)
     
    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
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
    writeString(char[] text, int offset, int len)
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
    writeString(tools.jackson.core.SerializableString sstr)
     
    tools.jackson.core.JsonGenerator
     
    tools.jackson.core.JsonGenerator
    writeUTF8String(byte[] text, int offset, int len)
     

    Methods inherited from class tools.jackson.core.base.GeneratorBase

    _asString, _checkRangeBoundsForByteArray, _checkRangeBoundsForCharArray, _checkRangeBoundsForString, _constructDefaultPrettyPrinter, _decodeSurrogate, _throwInternal, configure, has, ioContext, isClosed, isEnabled, objectWriteContext, streamWriteConstraints, streamWriteFeatures, writeBinary, writePOJO, writeRawValue, writeStartArray, writeStartObject, writeString, writeTree

    Methods inherited from class tools.jackson.core.JsonGenerator

    _constructWriteException, _constructWriteException, _constructWriteException, _constructWriteException, _copyCurrentContents, _copyCurrentContentsExact, _copyCurrentFloatValue, _copyCurrentFloatValueExact, _copyCurrentIntValue, _copyCurrentStringValue, _reportArgumentError, _reportError, _reportUnsupportedOperation, _reportUnsupportedOperation, _verifyOffsets, _wrapIOFailure, _writeTypePrefixUsingNative, _writeTypePrefixUsingWrapper, canOmitProperties, copyCurrentEvent, copyCurrentEventExact, copyCurrentStructure, copyCurrentStructureExact, getCharacterEscapes, getHighestNonEscapedChar, getSchema, setCharacterEscapes, writeArray, writeArray, writeArray, writeArray, writeArrayPropertyStart, writeBinary, writeBinary, writeBinary, writeBinaryProperty, writeBooleanProperty, writeEmbeddedObject, writeNullProperty, writeNumber, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeNumberProperty, writeObjectPropertyStart, writeOmittedProperty, writePOJOProperty, writeRaw, writeStringProperty, writeTypePrefix, writeTypeSuffix

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MIN_INT_AS_LONG

      protected static final long MIN_INT_AS_LONG
      See Also:
    • MAX_INT_AS_LONG

      protected static final long MAX_INT_AS_LONG
      See Also:
    • PLAIN_NUMBER_P

      protected static final Pattern PLAIN_NUMBER_P
    • TAG_BINARY

      protected static final String TAG_BINARY
    • _formatWriteFeatures

      protected int _formatWriteFeatures
      Bit flag composed of bits that indicate which YAMLWriteFeatures are enabled.
    • _writer

      protected Writer _writer
    • _outputOptions

      protected org.snakeyaml.engine.v2.api.DumpSettings _outputOptions
    • _cfgMinimizeQuotes

      protected final boolean _cfgMinimizeQuotes
    • _docVersion

      protected final org.snakeyaml.engine.v2.common.SpecVersion _docVersion
    • _streamWriteContext

      protected tools.jackson.core.util.SimpleStreamWriteContext _streamWriteContext
    • _emitter

      protected org.snakeyaml.engine.v2.emitter.Emitter _emitter
    • _objectId

      protected String _objectId
      YAML supports native Object identifiers, so databinder may indicate need to output one.
    • _typeId

      protected String _typeId
      YAML supports native Type identifiers, so databinder may indicate need to output one.
    • _rootValueCount

      protected int _rootValueCount
    • _quotingChecker

      protected final StringQuotingChecker _quotingChecker
  • Constructor Details

    • YAMLGenerator

      public YAMLGenerator(tools.jackson.core.ObjectWriteContext writeContext, tools.jackson.core.io.IOContext ioCtxt, int streamWriteFeatures, int yamlFeatures, StringQuotingChecker quotingChecker, Writer out, org.snakeyaml.engine.v2.common.SpecVersion version, org.snakeyaml.engine.v2.api.DumpSettings dumpOptions)
  • Method Details

    • buildDumperOptions

      protected org.snakeyaml.engine.v2.api.DumpSettings buildDumperOptions(int streamWriteFeatures, int yamlFeatures, org.snakeyaml.engine.v2.common.SpecVersion version)
    • 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
    • streamWriteContext

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

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

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

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

      public int streamWriteOutputBuffered()
      SnakeYAML does not expose buffered content amount, so we can only return -1 from here
      Specified by:
      streamWriteOutputBuffered 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
    • getPrettyPrinter

      public tools.jackson.core.PrettyPrinter getPrettyPrinter()
      Overrides:
      getPrettyPrinter in class tools.jackson.core.JsonGenerator
    • isEnabled

      public final boolean isEnabled(YAMLWriteFeature f)
    • writeName

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

      public tools.jackson.core.JsonGenerator writeName(tools.jackson.core.SerializableString name) throws tools.jackson.core.JacksonException
      Overrides:
      writeName in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writePropertyId

      public tools.jackson.core.JsonGenerator writePropertyId(long id) throws tools.jackson.core.JacksonException
      Specified by:
      writePropertyId in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • flush

      public final 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
      Overrides:
      close in class tools.jackson.core.base.GeneratorBase
    • _closeInput

      protected void _closeInput() throws IOException
      Specified by:
      _closeInput in class tools.jackson.core.base.GeneratorBase
      Throws:
      IOException
    • writeStartArray

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

      public tools.jackson.core.JsonGenerator writeStartArray(Object currValue) throws tools.jackson.core.JacksonException
      Specified by:
      writeStartArray in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeEndArray

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

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

      public tools.jackson.core.JsonGenerator writeStartObject(Object currValue) throws tools.jackson.core.JacksonException
      Specified by:
      writeStartObject in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeEndObject

      public tools.jackson.core.JsonGenerator writeEndObject() throws tools.jackson.core.JacksonException
      Specified by:
      writeEndObject in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeString

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

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

      public tools.jackson.core.JsonGenerator writeString(tools.jackson.core.SerializableString sstr) throws tools.jackson.core.JacksonException
      Overrides:
      writeString in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writeRawUTF8String

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

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

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

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

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

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

      public tools.jackson.core.JsonGenerator writeRawValue(String text) throws tools.jackson.core.JacksonException
      Overrides:
      writeRawValue in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writeRawValue

      public tools.jackson.core.JsonGenerator writeRawValue(String text, int offset, int len) throws tools.jackson.core.JacksonException
      Overrides:
      writeRawValue in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writeRawValue

      public tools.jackson.core.JsonGenerator writeRawValue(char[] text, int offset, int len) throws tools.jackson.core.JacksonException
      Overrides:
      writeRawValue in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • writeBinary

      public tools.jackson.core.JsonGenerator writeBinary(tools.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len) throws tools.jackson.core.JacksonException
      Specified by:
      writeBinary in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeBoolean

      public tools.jackson.core.JsonGenerator writeBoolean(boolean state) throws tools.jackson.core.JacksonException
      Specified by:
      writeBoolean in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNumber

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

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

      public tools.jackson.core.JsonGenerator writeNumber(long l) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNumber

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

      public tools.jackson.core.JsonGenerator writeNumber(double d) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(float f) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(BigDecimal dec) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNumber

      public tools.jackson.core.JsonGenerator writeNumber(String encodedValue) throws tools.jackson.core.JacksonException
      Specified by:
      writeNumber in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeNull

      public tools.jackson.core.JsonGenerator writeNull() throws tools.jackson.core.JacksonException
      Specified by:
      writeNull in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • canWriteObjectId

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

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

      public tools.jackson.core.JsonGenerator writeTypeId(Object id) throws tools.jackson.core.JacksonException
      Overrides:
      writeTypeId in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeObjectRef

      public tools.jackson.core.JsonGenerator writeObjectRef(Object id) throws tools.jackson.core.JacksonException
      Overrides:
      writeObjectRef in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • writeObjectId

      public tools.jackson.core.JsonGenerator writeObjectId(Object id) throws tools.jackson.core.JacksonException
      Overrides:
      writeObjectId in class tools.jackson.core.JsonGenerator
      Throws:
      tools.jackson.core.JacksonException
    • _verifyValueWrite

      protected final void _verifyValueWrite(String typeMsg) throws tools.jackson.core.JacksonException
      Specified by:
      _verifyValueWrite in class tools.jackson.core.base.GeneratorBase
      Throws:
      tools.jackson.core.JacksonException
    • _releaseBuffers

      protected void _releaseBuffers()
      Specified by:
      _releaseBuffers in class tools.jackson.core.base.GeneratorBase
    • _writeScalar

      protected void _writeScalar(String value, String type, org.snakeyaml.engine.v2.common.ScalarStyle style) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _scalarEvent

      protected org.snakeyaml.engine.v2.events.ScalarEvent _scalarEvent(String value, org.snakeyaml.engine.v2.common.ScalarStyle style)
    • _lf

      protected String _lf()
    • _emitStartDocument

      protected void _emitStartDocument() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _emitEndDocument

      protected void _emitEndDocument() throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _emit

      protected final void _emit(org.snakeyaml.engine.v2.events.Event e)