Class TomlGenerator
- java.lang.Object
-
- com.fasterxml.jackson.core.JsonGenerator
-
- com.fasterxml.jackson.core.base.GeneratorBase
-
- com.fasterxml.jackson.dataformat.toml.TomlGenerator
-
- All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned
,java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
final class TomlGenerator extends com.fasterxml.jackson.core.base.GeneratorBase
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringBuilder
_basePath
protected java.io.Writer
_out
UnderlyingWriter
used for output.protected char[]
_outputBuffer
Intermediate buffer in which contents are buffered before being written using_out
.protected int
_outputEnd
Offset to index after the last valid index in_outputBuffer
.protected int
_outputTail
Pointer to the next available location in_outputBuffer
protected com.fasterxml.jackson.core.StreamWriteConstraints
_streamWriteConstraints
protected TomlWriteContext
_streamWriteContext
Current context, in form we can use it (GeneratorBase has untyped reference; left as null)private int
_tomlFeatures
protected static int
SHORT_WRITE
-
Fields inherited from class com.fasterxml.jackson.core.base.GeneratorBase
_cfgNumbersAsStrings, _closed, _features, _ioContext, _objectCodec, _writeContext, DERIVED_FEATURES_MASK, 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 TomlGenerator(com.fasterxml.jackson.core.io.IOContext ioCtxt, int stdFeatures, int tomlFeatures, com.fasterxml.jackson.core.ObjectCodec codec, java.io.Writer out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_appendPropertyName(java.lang.StringBuilder path, java.lang.String name)
protected void
_flushBuffer()
protected void
_releaseBuffers()
protected void
_verifyValueWrite(java.lang.String typeMsg)
protected void
_verifyValueWrite(java.lang.String typeMsg, boolean forceMaterializeKey)
protected void
_writeRaw(char c)
protected void
_writeRaw(char[] text, int offset, int len)
protected void
_writeRaw(java.lang.String text)
protected void
_writeRaw(java.lang.StringBuilder text)
protected void
_writeRawLong(java.lang.String text)
protected void
_writeRawLong(java.lang.StringBuilder text)
private void
_writeStringImpl(int categoryMask, char[] text, int offset, int len)
private void
_writeStringImpl(int categoryMask, java.lang.String name)
void
assignCurrentValue(java.lang.Object v)
boolean
canWriteObjectId()
boolean
canWriteTypeId()
void
close()
java.lang.Object
currentValue()
void
flush()
com.fasterxml.jackson.core.StreamWriteConstraints
streamWriteConstraints()
com.fasterxml.jackson.core.Version
version()
void
writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len)
void
writeBoolean(boolean state)
private void
writeCurrentPath()
void
writeEndArray()
void
writeEndObject()
void
writeFieldName(java.lang.String name)
void
writeNull()
void
writeNumber(double d)
void
writeNumber(float f)
void
writeNumber(int i)
void
writeNumber(long l)
void
writeNumber(short v)
void
writeNumber(java.lang.String encodedValue)
void
writeNumber(java.math.BigDecimal dec)
void
writeNumber(java.math.BigInteger v)
void
writePOJO(java.lang.Object value)
void
writeRaw(char c)
void
writeRaw(char[] text, int offset, int len)
void
writeRaw(com.fasterxml.jackson.core.SerializableString text)
void
writeRaw(java.lang.String text)
void
writeRaw(java.lang.String text, int offset, int len)
void
writeRawUTF8String(byte[] text, int offset, int len)
void
writeStartArray()
void
writeStartArray(java.lang.Object currValue)
void
writeStartObject()
void
writeStartObject(java.lang.Object forValue)
void
writeString(char[] text, int offset, int len)
void
writeString(java.lang.String text)
void
writeUTF8String(byte[] text, int offset, int len)
private void
writeValueEnd()
-
Methods inherited from class com.fasterxml.jackson.core.base.GeneratorBase
_asString, _checkRangeBoundsForByteArray, _checkRangeBoundsForCharArray, _checkRangeBoundsForString, _checkStdFeatureChanges, _constructDefaultPrettyPrinter, _decodeSurrogate, disable, enable, getCodec, getFeatureMask, getOutputContext, ioContext, isClosed, isEnabled, overrideStdFeatures, setCodec, setFeatureMask, useDefaultPrettyPrinter, writeBinary, writeFieldName, writeObject, writeRawValue, writeRawValue, writeRawValue, writeRawValue, writeString, writeTree
-
Methods inherited from class com.fasterxml.jackson.core.JsonGenerator
_constructWriteException, _constructWriteException, _constructWriteException, _constructWriteException, _copyCurrentContents, _copyCurrentFloatValue, _copyCurrentFloatValueExact, _copyCurrentIntValue, _copyCurrentStringValue, _reportError, _reportUnsupportedOperation, _reportUnsupportedOperation, _throwInternal, _verifyOffsets, _writeSimpleObject, canOmitFields, canUseSchema, canWriteBinaryNatively, canWriteFormattedNumbers, configure, copyCurrentEvent, copyCurrentEventExact, copyCurrentStructure, getCharacterEscapes, getCurrentValue, getFormatFeatures, getHighestEscapedChar, getOutputBuffered, getOutputTarget, getPrettyPrinter, getSchema, getWriteCapabilities, isEnabled, overrideFormatFeatures, setCharacterEscapes, setCurrentValue, setHighestNonEscapedChar, setPrettyPrinter, setRootValueSeparator, setSchema, writeArray, writeArray, writeArray, writeArray, writeArrayFieldStart, writeBinary, writeBinary, writeBinary, writeBinaryField, writeBooleanField, writeEmbeddedObject, writeFieldId, writeNullField, writeNumber, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeObjectField, writeObjectFieldStart, writeObjectId, writeObjectRef, writeOmittedField, writePOJOField, writeStartArray, writeStartArray, writeStartObject, writeString, writeStringField, writeTypeId, writeTypePrefix, writeTypeSuffix
-
-
-
-
Field Detail
-
SHORT_WRITE
protected static final int SHORT_WRITE
- See Also:
- Constant Field Values
-
_streamWriteConstraints
protected final com.fasterxml.jackson.core.StreamWriteConstraints _streamWriteConstraints
- Since:
- 2.16
-
_out
protected final java.io.Writer _out
UnderlyingWriter
used for output.
-
_tomlFeatures
private final int _tomlFeatures
-
_streamWriteContext
protected TomlWriteContext _streamWriteContext
Current context, in form we can use it (GeneratorBase has untyped reference; left as null)
-
_outputBuffer
protected char[] _outputBuffer
Intermediate buffer in which contents are buffered before being written using_out
.
-
_outputTail
protected int _outputTail
Pointer to the next available location in_outputBuffer
-
_outputEnd
protected final int _outputEnd
Offset to index after the last valid index in_outputBuffer
. Typically same as length of the buffer.
-
_basePath
protected final java.lang.StringBuilder _basePath
-
-
Method Detail
-
streamWriteConstraints
public com.fasterxml.jackson.core.StreamWriteConstraints streamWriteConstraints()
- Overrides:
streamWriteConstraints
in classcom.fasterxml.jackson.core.JsonGenerator
-
version
public com.fasterxml.jackson.core.Version version()
- Specified by:
version
in interfacecom.fasterxml.jackson.core.Versioned
- Overrides:
version
in classcom.fasterxml.jackson.core.base.GeneratorBase
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Specified by:
flush
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
java.io.IOException
-
_releaseBuffers
protected void _releaseBuffers()
- Specified by:
_releaseBuffers
in classcom.fasterxml.jackson.core.base.GeneratorBase
-
_flushBuffer
protected void _flushBuffer() throws java.io.IOException
- Throws:
java.io.IOException
-
_writeRaw
protected void _writeRaw(char c) throws java.io.IOException
- Throws:
java.io.IOException
-
_writeRaw
protected void _writeRaw(java.lang.String text) throws java.io.IOException
- Throws:
java.io.IOException
-
_writeRaw
protected void _writeRaw(java.lang.StringBuilder text) throws java.io.IOException
- Throws:
java.io.IOException
-
_writeRaw
protected void _writeRaw(char[] text, int offset, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
_writeRawLong
protected void _writeRawLong(java.lang.String text) throws java.io.IOException
- Throws:
java.io.IOException
-
_writeRawLong
protected void _writeRawLong(java.lang.StringBuilder text) throws java.io.IOException
- Throws:
java.io.IOException
-
currentValue
public java.lang.Object currentValue()
- Overrides:
currentValue
in classcom.fasterxml.jackson.core.base.GeneratorBase
-
assignCurrentValue
public void assignCurrentValue(java.lang.Object v)
- Overrides:
assignCurrentValue
in classcom.fasterxml.jackson.core.base.GeneratorBase
-
canWriteObjectId
public boolean canWriteObjectId()
- Overrides:
canWriteObjectId
in classcom.fasterxml.jackson.core.JsonGenerator
-
canWriteTypeId
public boolean canWriteTypeId()
- Overrides:
canWriteTypeId
in classcom.fasterxml.jackson.core.JsonGenerator
-
writeFieldName
public void writeFieldName(java.lang.String name) throws java.io.IOException
- Specified by:
writeFieldName
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeStartArray
public void writeStartArray() throws java.io.IOException
- Specified by:
writeStartArray
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeStartArray
public void writeStartArray(java.lang.Object currValue) throws java.io.IOException
- Overrides:
writeStartArray
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeEndArray
public void writeEndArray() throws java.io.IOException
- Specified by:
writeEndArray
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeStartObject
public void writeStartObject() throws java.io.IOException
- Specified by:
writeStartObject
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeStartObject
public void writeStartObject(java.lang.Object forValue) throws java.io.IOException
- Overrides:
writeStartObject
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
java.io.IOException
-
writeEndObject
public void writeEndObject() throws java.io.IOException
- Specified by:
writeEndObject
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeString
public void writeString(java.lang.String text) throws java.io.IOException
- Specified by:
writeString
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeString
public void writeString(char[] text, int offset, int len) throws java.io.IOException
- Specified by:
writeString
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeRawUTF8String
public void writeRawUTF8String(byte[] text, int offset, int len) throws java.io.IOException
- Specified by:
writeRawUTF8String
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeUTF8String
public void writeUTF8String(byte[] text, int offset, int len) throws java.io.IOException
- Specified by:
writeUTF8String
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeRaw
public void writeRaw(java.lang.String text) throws java.io.IOException
- Specified by:
writeRaw
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeRaw
public void writeRaw(java.lang.String text, int offset, int len) throws java.io.IOException
- Specified by:
writeRaw
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeRaw
public void writeRaw(char[] text, int offset, int len) throws java.io.IOException
- Specified by:
writeRaw
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeRaw
public void writeRaw(char c) throws java.io.IOException
- Specified by:
writeRaw
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeRaw
public void writeRaw(com.fasterxml.jackson.core.SerializableString text) throws java.io.IOException
- Overrides:
writeRaw
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeBinary
public void writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len) throws java.io.IOException
- Specified by:
writeBinary
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeBoolean
public void writeBoolean(boolean state) throws java.io.IOException
- Specified by:
writeBoolean
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(short v) throws java.io.IOException
- Overrides:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(int i) throws java.io.IOException
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(long l) throws java.io.IOException
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(java.math.BigInteger v) throws java.io.IOException
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(double d) throws java.io.IOException
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(float f) throws java.io.IOException
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(java.math.BigDecimal dec) throws java.io.IOException
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeNumber
public void writeNumber(java.lang.String encodedValue) throws java.io.IOException
- Specified by:
writeNumber
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
writeNull
public void writeNull() throws java.io.IOException
- Specified by:
writeNull
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
_verifyValueWrite
protected void _verifyValueWrite(java.lang.String typeMsg) throws java.io.IOException
- Specified by:
_verifyValueWrite
in classcom.fasterxml.jackson.core.base.GeneratorBase
- Throws:
java.io.IOException
-
_verifyValueWrite
protected void _verifyValueWrite(java.lang.String typeMsg, boolean forceMaterializeKey) throws java.io.IOException
- Throws:
java.io.IOException
-
writeCurrentPath
private void writeCurrentPath() throws java.io.IOException
- Throws:
java.io.IOException
-
writeValueEnd
private void writeValueEnd() throws java.io.IOException
- Throws:
java.io.IOException
-
_appendPropertyName
private void _appendPropertyName(java.lang.StringBuilder path, java.lang.String name) throws java.io.IOException
- Throws:
java.io.IOException
-
_writeStringImpl
private void _writeStringImpl(int categoryMask, java.lang.String name) throws java.io.IOException
- Throws:
java.io.IOException
-
_writeStringImpl
private void _writeStringImpl(int categoryMask, char[] text, int offset, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
writePOJO
public void writePOJO(java.lang.Object value) throws java.io.IOException
- Overrides:
writePOJO
in classcom.fasterxml.jackson.core.JsonGenerator
- Throws:
java.io.IOException
-
-