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
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final org.snakeyaml.engine.v2.common.SpecVersionprotected org.snakeyaml.engine.v2.emitter.Emitterprotected intBit flag composed of bits that indicate whichYAMLWriteFeatures are enabled.protected StringYAML supports native Object identifiers, so databinder may indicate need to output one.protected org.snakeyaml.engine.v2.api.DumpSettingsprotected final StringQuotingCheckerprotected intprotected tools.jackson.core.util.SimpleStreamWriteContextprotected StringYAML supports native Type identifiers, so databinder may indicate need to output one.protected Writerprotected static final longprotected static final longprotected static final Patternprotected static final StringFields 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
ConstructorsConstructorDescriptionYAMLGenerator(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 TypeMethodDescriptionprotected voidprotected final void_emit(org.snakeyaml.engine.v2.events.Event e) protected voidprotected voidprotected String_lf()protected voidprotected org.snakeyaml.engine.v2.events.ScalarEvent_scalarEvent(String value, org.snakeyaml.engine.v2.common.ScalarStyle style) protected final void_verifyValueWrite(String typeMsg) protected void_writeScalar(String value, String type, org.snakeyaml.engine.v2.common.ScalarStyle style) final voidprotected org.snakeyaml.engine.v2.api.DumpSettingsbuildDumperOptions(int streamWriteFeatures, int yamlFeatures, org.snakeyaml.engine.v2.common.SpecVersion version) booleanbooleanvoidclose()final Objectfinal voidflush()tools.jackson.core.PrettyPrinterfinal booleantools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamWriteCapability>final tools.jackson.core.TokenStreamContextintSnakeYAML does not expose buffered content amount, so we can only return-1from heretools.jackson.core.Versionversion()tools.jackson.core.JsonGeneratorwriteBinary(tools.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len) tools.jackson.core.JsonGeneratorwriteBoolean(boolean state) tools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratorwriteName(tools.jackson.core.SerializableString name) tools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratorwriteNumber(double d) tools.jackson.core.JsonGeneratorwriteNumber(float f) tools.jackson.core.JsonGeneratorwriteNumber(int v) tools.jackson.core.JsonGeneratorwriteNumber(long l) tools.jackson.core.JsonGeneratorwriteNumber(short v) tools.jackson.core.JsonGeneratorwriteNumber(String encodedValue) tools.jackson.core.JsonGeneratorwriteNumber(BigDecimal dec) tools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratorwriteObjectId(Object id) tools.jackson.core.JsonGeneratorwriteObjectRef(Object id) tools.jackson.core.JsonGeneratorwritePropertyId(long id) tools.jackson.core.JsonGeneratorwriteRaw(char c) tools.jackson.core.JsonGeneratorwriteRaw(char[] text, int offset, int len) tools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratorwriteRawUTF8String(byte[] text, int offset, int len) tools.jackson.core.JsonGeneratorwriteRawValue(char[] text, int offset, int len) tools.jackson.core.JsonGeneratorwriteRawValue(String text) tools.jackson.core.JsonGeneratorwriteRawValue(String text, int offset, int len) tools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratorwriteStartArray(Object currValue) tools.jackson.core.JsonGeneratortools.jackson.core.JsonGeneratorwriteStartObject(Object currValue) tools.jackson.core.JsonGeneratorwriteString(char[] text, int offset, int len) tools.jackson.core.JsonGeneratorwriteString(String text) tools.jackson.core.JsonGeneratorwriteString(tools.jackson.core.SerializableString sstr) tools.jackson.core.JsonGeneratorwriteTypeId(Object id) tools.jackson.core.JsonGeneratorwriteUTF8String(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, writeTreeMethods 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
-
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
-
TAG_BINARY
-
_formatWriteFeatures
protected int _formatWriteFeaturesBit flag composed of bits that indicate whichYAMLWriteFeatures are enabled. -
_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
YAML supports native Object identifiers, so databinder may indicate need to output one. -
_typeId
YAML supports native Type identifiers, so databinder may indicate need to output one. -
_rootValueCount
protected int _rootValueCount -
_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:
versionin interfacetools.jackson.core.Versioned- Specified by:
versionin classtools.jackson.core.JsonGenerator
-
streamWriteContext
public final tools.jackson.core.TokenStreamContext streamWriteContext()- Specified by:
streamWriteContextin classtools.jackson.core.JsonGenerator
-
currentValue
- Specified by:
currentValuein classtools.jackson.core.JsonGenerator
-
assignCurrentValue
- Specified by:
assignCurrentValuein classtools.jackson.core.JsonGenerator
-
streamWriteOutputTarget
- Specified by:
streamWriteOutputTargetin classtools.jackson.core.JsonGenerator
-
streamWriteOutputBuffered
public int streamWriteOutputBuffered()SnakeYAML does not expose buffered content amount, so we can only return-1from here- Specified by:
streamWriteOutputBufferedin classtools.jackson.core.JsonGenerator
-
streamWriteCapabilities
public tools.jackson.core.util.JacksonFeatureSet<tools.jackson.core.StreamWriteCapability> streamWriteCapabilities()- Specified by:
streamWriteCapabilitiesin classtools.jackson.core.JsonGenerator
-
getPrettyPrinter
public tools.jackson.core.PrettyPrinter getPrettyPrinter()- Overrides:
getPrettyPrinterin classtools.jackson.core.JsonGenerator
-
isEnabled
-
writeName
public tools.jackson.core.JsonGenerator writeName(String name) throws tools.jackson.core.JacksonException - Specified by:
writeNamein classtools.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:
writeNamein classtools.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:
writePropertyIdin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
flush
public final void flush() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classtools.jackson.core.base.GeneratorBase
-
_closeInput
- Specified by:
_closeInputin classtools.jackson.core.base.GeneratorBase- Throws:
IOException
-
writeStartArray
public tools.jackson.core.JsonGenerator writeStartArray() throws tools.jackson.core.JacksonException- Specified by:
writeStartArrayin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeStartArray
public tools.jackson.core.JsonGenerator writeStartArray(Object currValue) throws tools.jackson.core.JacksonException - Specified by:
writeStartArrayin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeEndArray
public tools.jackson.core.JsonGenerator writeEndArray() throws tools.jackson.core.JacksonException- Specified by:
writeEndArrayin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeStartObject
public tools.jackson.core.JsonGenerator writeStartObject() throws tools.jackson.core.JacksonException- Specified by:
writeStartObjectin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeStartObject
public tools.jackson.core.JsonGenerator writeStartObject(Object currValue) throws tools.jackson.core.JacksonException - Specified by:
writeStartObjectin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeEndObject
public tools.jackson.core.JsonGenerator writeEndObject() throws tools.jackson.core.JacksonException- Specified by:
writeEndObjectin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeString
public tools.jackson.core.JsonGenerator writeString(String text) throws tools.jackson.core.JacksonException - Specified by:
writeStringin classtools.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:
writeStringin classtools.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:
writeStringin classtools.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:
writeRawUTF8Stringin classtools.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:
writeUTF8Stringin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeRaw
public tools.jackson.core.JsonGenerator writeRaw(String text) throws tools.jackson.core.JacksonException - Specified by:
writeRawin classtools.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:
writeRawin classtools.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:
writeRawin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeRaw
public tools.jackson.core.JsonGenerator writeRaw(char c) throws tools.jackson.core.JacksonException - Specified by:
writeRawin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeRawValue
public tools.jackson.core.JsonGenerator writeRawValue(String text) throws tools.jackson.core.JacksonException - Overrides:
writeRawValuein classtools.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:
writeRawValuein classtools.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:
writeRawValuein classtools.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:
writeBinaryin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeBoolean
public tools.jackson.core.JsonGenerator writeBoolean(boolean state) throws tools.jackson.core.JacksonException - Specified by:
writeBooleanin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(short v) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(int v) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(long l) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(BigInteger v) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(double d) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(float f) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(BigDecimal dec) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNumber
public tools.jackson.core.JsonGenerator writeNumber(String encodedValue) throws tools.jackson.core.JacksonException - Specified by:
writeNumberin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeNull
public tools.jackson.core.JsonGenerator writeNull() throws tools.jackson.core.JacksonException- Specified by:
writeNullin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
canWriteObjectId
public boolean canWriteObjectId()- Overrides:
canWriteObjectIdin classtools.jackson.core.JsonGenerator
-
canWriteTypeId
public boolean canWriteTypeId()- Overrides:
canWriteTypeIdin classtools.jackson.core.JsonGenerator
-
writeTypeId
public tools.jackson.core.JsonGenerator writeTypeId(Object id) throws tools.jackson.core.JacksonException - Overrides:
writeTypeIdin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeObjectRef
public tools.jackson.core.JsonGenerator writeObjectRef(Object id) throws tools.jackson.core.JacksonException - Overrides:
writeObjectRefin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
writeObjectId
public tools.jackson.core.JsonGenerator writeObjectId(Object id) throws tools.jackson.core.JacksonException - Overrides:
writeObjectIdin classtools.jackson.core.JsonGenerator- Throws:
tools.jackson.core.JacksonException
-
_verifyValueWrite
- Specified by:
_verifyValueWritein classtools.jackson.core.base.GeneratorBase- Throws:
tools.jackson.core.JacksonException
-
_releaseBuffers
protected void _releaseBuffers()- Specified by:
_releaseBuffersin classtools.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
-
_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)
-