com.fasterxml.jackson.dataformat.avro

## Class AvroGenerator

- java.lang.Object
- - com.fasterxml.jackson.core.JsonGenerator
  - - com.fasterxml.jackson.core.base.GeneratorBase
    - - com.fasterxml.jackson.dataformat.avro.AvroGenerator

- All Implemented Interfaces:
    com.fasterxml.jackson.core.Versioned, Closeable, Flushable, AutoCloseable

      public class AvroGenerator
      extends com.fasterxml.jackson.core.base.GeneratorBase

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AvroGenerator.Feature` Enumeration that defines all togglable features for Avro generators

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AvroWriteContext` | `_avroContext` Current context
    `protected boolean` | `_complete` Flag that is set when the whole content is complete, can be output.
    `protected int` | `_formatFeatures` Bit flag composed of bits that indicate which `AvroGenerator.Feature`s are enabled.
    `protected com.fasterxml.jackson.core.io.IOContext` | `_ioContext`
    `protected OutputStream` | `_output`
    `protected AvroWriteContext` | `_rootContext` Reference to the root context since that is needed for serialization
    `protected AvroSchema` | `_rootSchema`

    - ### Fields inherited from class com.fasterxml.jackson.core.base.GeneratorBase

      `_cfgNumbersAsStrings, _closed, _features, _objectCodec, _writeContext, DERIVED_FEATURES_MASK, SURR1_FIRST, SURR1_LAST, SURR2_FIRST, SURR2_LAST, WRITE_BINARY, WRITE_BOOLEAN, WRITE_NULL, WRITE_NUMBER, WRITE_RAW, WRITE_STRING`

    - ### Fields inherited from class com.fasterxml.jackson.core.JsonGenerator

      `_cfgPrettyPrinter`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AvroGenerator(com.fasterxml.jackson.core.io.IOContext ctxt, int jsonFeatures, int avroFeatures, com.fasterxml.jackson.core.ObjectCodec codec, OutputStream output)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `_complete()`
    `protected void` | `_releaseBuffers()`
    `protected void` | `_verifyValueWrite(String typeMsg)`
    `boolean` | `canUseSchema(com.fasterxml.jackson.core.FormatSchema schema)`
    `void` | `close()`
    `AvroGenerator` | `configure(AvroGenerator.Feature f, boolean state)`
    `AvroGenerator` | `disable(AvroGenerator.Feature f)`
    `AvroGenerator` | `enable(AvroGenerator.Feature f)`
    `void` | `flush()`
    `int` | `getOutputBuffered()` Unfortunately we have no visibility into buffering Avro codec does; and need to return `-1` to reflect that lack of knowledge.
    `Object` | `getOutputTarget()`
    `AvroSchema` | `getSchema()`
    `boolean` | `isEnabled(AvroGenerator.Feature f)`
    `com.fasterxml.jackson.core.JsonGenerator` | `overrideFormatFeatures(int values, int mask)`
    `AvroGenerator` | `setPrettyPrinter(com.fasterxml.jackson.core.PrettyPrinter pp)` Not relevant, as binary formats typically have no indentation.
    `void` | `setSchema(AvroSchema schema)`
    `void` | `setSchema(com.fasterxml.jackson.core.FormatSchema schema)`
    `AvroGenerator` | `useDefaultPrettyPrinter()` Not sure what to do here; could reset indentation to some value maybe?
    `com.fasterxml.jackson.core.Version` | `version()`
    `void` | `writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len)`
    `void` | `writeBoolean(boolean state)`
    `void` | `writeEndArray()`
    `void` | `writeEndObject()`
    `void` | `writeFieldName(com.fasterxml.jackson.core.SerializableString name)`
    `void` | `writeFieldName(String name)`
    `void` | `writeNull()`
    `void` | `writeNumber(BigDecimal dec)`
    `void` | `writeNumber(BigInteger v)`
    `void` | `writeNumber(double d)`
    `void` | `writeNumber(float f)`
    `void` | `writeNumber(int i)`
    `void` | `writeNumber(long l)`
    `void` | `writeNumber(String encodedValue)`
    `void` | `writeRaw(char c)`
    `void` | `writeRaw(char[] text, int offset, int len)`
    `void` | `writeRaw(String text)`
    `void` | `writeRaw(String text, int offset, int len)`
    `void` | `writeRawUTF8String(byte[] text, int offset, int len)`
    `void` | `writeRawValue(char[] text, int offset, int len)`
    `void` | `writeRawValue(String text)`
    `void` | `writeRawValue(String text, int offset, int len)`
    `void` | `writeStartArray()`
    `void` | `writeStartObject()`
    `void` | `writeString(char[] text, int offset, int len)`
    `void` | `writeString(com.fasterxml.jackson.core.SerializableString sstr)`
    `void` | `writeString(String text)`
    `void` | `writeStringField(String fieldName, String value)`
    `void` | `writeUTF8String(byte[] text, int offset, int len)`

    - ### Methods inherited from class com.fasterxml.jackson.core.base.GeneratorBase

      `_checkStdFeatureChanges, _constructDefaultPrettyPrinter, _decodeSurrogate, disable, enable, getCodec, getCurrentValue, getFeatureMask, getOutputContext, isClosed, isEnabled, overrideStdFeatures, setCodec, setCurrentValue, setFeatureMask, writeBinary, writeObject, writeRawValue, writeStartObject, writeTree`

    - ### Methods inherited from class com.fasterxml.jackson.core.JsonGenerator

      `_reportError, _reportUnsupportedOperation, _throwInternal, _verifyOffsets, _writeSimpleObject, canOmitFields, canWriteBinaryNatively, canWriteFormattedNumbers, canWriteObjectId, canWriteTypeId, configure, copyCurrentEvent, copyCurrentStructure, getCharacterEscapes, getFormatFeatures, getHighestEscapedChar, getPrettyPrinter, setCharacterEscapes, setHighestNonEscapedChar, setRootValueSeparator, writeArray, writeArray, writeArray, writeArrayFieldStart, writeBinary, writeBinary, writeBinary, writeBinaryField, writeBooleanField, writeEmbeddedObject, writeFieldId, writeNullField, writeNumber, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeObjectField, writeObjectFieldStart, writeObjectId, writeObjectRef, writeOmittedField, writeRaw, writeStartArray, writeTypeId`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _ioContext

          protected final com.fasterxml.jackson.core.io.IOContext _ioContext

    - #### _formatFeatures

          protected int _formatFeatures

      Bit flag composed of bits that indicate which `AvroGenerator.Feature`s are enabled.

    - #### _rootSchema

          protected AvroSchema _rootSchema

    - #### _output

          protected final OutputStream _output

    - #### _rootContext

          protected AvroWriteContext _rootContext

      Reference to the root context since that is needed for serialization

    - #### _avroContext

          protected AvroWriteContext _avroContext

      Current context

    - #### _complete

          protected boolean _complete

      Flag that is set when the whole content is complete, can be output.

  - ### Constructor Detail

    - #### AvroGenerator

          public AvroGenerator(com.fasterxml.jackson.core.io.IOContext ctxt,
                       int jsonFeatures,
                       int avroFeatures,
                       com.fasterxml.jackson.core.ObjectCodec codec,
                       OutputStream output)
                        throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### setSchema

          public void setSchema(AvroSchema schema)

    - #### version

          public com.fasterxml.jackson.core.Version version()

      Specified by:
        `version` in interface `com.fasterxml.jackson.core.Versioned`
      Overrides:
        `version` in class `com.fasterxml.jackson.core.base.GeneratorBase`

    - #### useDefaultPrettyPrinter

          public AvroGenerator useDefaultPrettyPrinter()

      Not sure what to do here; could reset indentation to some value maybe?
      Overrides:
        `useDefaultPrettyPrinter` in class `com.fasterxml.jackson.core.base.GeneratorBase`

    - #### setPrettyPrinter

          public AvroGenerator setPrettyPrinter(com.fasterxml.jackson.core.PrettyPrinter pp)

      Not relevant, as binary formats typically have no indentation.
      Overrides:
        `setPrettyPrinter` in class `com.fasterxml.jackson.core.JsonGenerator`

    - #### getOutputTarget

          public Object getOutputTarget()

      Overrides:
        `getOutputTarget` in class `com.fasterxml.jackson.core.JsonGenerator`

    - #### getOutputBuffered

          public int getOutputBuffered()

      Unfortunately we have no visibility into buffering Avro codec does; and need to return `-1` to reflect that lack of knowledge.
      Overrides:
        `getOutputBuffered` in class `com.fasterxml.jackson.core.JsonGenerator`

    - #### canUseSchema

          public boolean canUseSchema(com.fasterxml.jackson.core.FormatSchema schema)

      Overrides:
        `canUseSchema` in class `com.fasterxml.jackson.core.JsonGenerator`

    - #### getSchema

          public AvroSchema getSchema()

      Overrides:
        `getSchema` in class `com.fasterxml.jackson.core.JsonGenerator`

    - #### setSchema

          public void setSchema(com.fasterxml.jackson.core.FormatSchema schema)

      Overrides:
        `setSchema` in class `com.fasterxml.jackson.core.JsonGenerator`

    - #### enable

          public AvroGenerator enable(AvroGenerator.Feature f)

    - #### disable

          public AvroGenerator disable(AvroGenerator.Feature f)

    - #### isEnabled

          public final boolean isEnabled(AvroGenerator.Feature f)

    - #### configure

          public AvroGenerator configure(AvroGenerator.Feature f,
                                boolean state)

    - #### overrideFormatFeatures

          public com.fasterxml.jackson.core.JsonGenerator overrideFormatFeatures(int values,
                                                                        int mask)

      Overrides:
        `overrideFormatFeatures` in class `com.fasterxml.jackson.core.JsonGenerator`

    - #### writeFieldName

          public final void writeFieldName(String name)
                                    throws IOException

      Specified by:
        `writeFieldName` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeFieldName

          public final void writeFieldName(com.fasterxml.jackson.core.SerializableString name)
                                    throws IOException

      Overrides:
        `writeFieldName` in class `com.fasterxml.jackson.core.base.GeneratorBase`
      Throws:
        `IOException`

    - #### writeStringField

          public final void writeStringField(String fieldName,
                              String value)
                                      throws IOException

      Overrides:
        `writeStringField` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### flush

          public final void flush()
                           throws IOException

      Specified by:
        `flush` in interface `Flushable`
      Specified by:
        `flush` in class `com.fasterxml.jackson.core.base.GeneratorBase`
      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Overrides:
        `close` in class `com.fasterxml.jackson.core.base.GeneratorBase`
      Throws:
        `IOException`

    - #### writeStartArray

          public final void writeStartArray()
                                     throws IOException

      Specified by:
        `writeStartArray` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeEndArray

          public final void writeEndArray()
                                   throws IOException

      Specified by:
        `writeEndArray` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeStartObject

          public final void writeStartObject()
                                      throws IOException

      Specified by:
        `writeStartObject` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeEndObject

          public final void writeEndObject()
                                    throws IOException

      Specified by:
        `writeEndObject` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeString

          public void writeString(String text)
                           throws IOException

      Specified by:
        `writeString` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeString

          public void writeString(char[] text,
                         int offset,
                         int len)
                           throws IOException

      Specified by:
        `writeString` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeString

          public final void writeString(com.fasterxml.jackson.core.SerializableString sstr)
                                 throws IOException

      Overrides:
        `writeString` in class `com.fasterxml.jackson.core.base.GeneratorBase`
      Throws:
        `IOException`

    - #### writeRawUTF8String

          public void writeRawUTF8String(byte[] text,
                                int offset,
                                int len)
                                  throws IOException

      Specified by:
        `writeRawUTF8String` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeUTF8String

          public final void writeUTF8String(byte[] text,
                             int offset,
                             int len)
                                     throws IOException

      Specified by:
        `writeUTF8String` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeRaw

          public void writeRaw(String text)
                        throws IOException

      Specified by:
        `writeRaw` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeRaw

          public void writeRaw(String text,
                      int offset,
                      int len)
                        throws IOException

      Specified by:
        `writeRaw` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeRaw

          public void writeRaw(char[] text,
                      int offset,
                      int len)
                        throws IOException

      Specified by:
        `writeRaw` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeRaw

          public void writeRaw(char c)
                        throws IOException

      Specified by:
        `writeRaw` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeRawValue

          public void writeRawValue(String text)
                             throws IOException

      Overrides:
        `writeRawValue` in class `com.fasterxml.jackson.core.base.GeneratorBase`
      Throws:
        `IOException`

    - #### writeRawValue

          public void writeRawValue(String text,
                           int offset,
                           int len)
                             throws IOException

      Overrides:
        `writeRawValue` in class `com.fasterxml.jackson.core.base.GeneratorBase`
      Throws:
        `IOException`

    - #### writeRawValue

          public void writeRawValue(char[] text,
                           int offset,
                           int len)
                             throws IOException

      Overrides:
        `writeRawValue` in class `com.fasterxml.jackson.core.base.GeneratorBase`
      Throws:
        `IOException`

    - #### writeBinary

          public void writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant,
                         byte[] data,
                         int offset,
                         int len)
                           throws IOException

      Specified by:
        `writeBinary` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeBoolean

          public void writeBoolean(boolean state)
                            throws IOException

      Specified by:
        `writeBoolean` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeNull

          public void writeNull()
                         throws IOException

      Specified by:
        `writeNull` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeNumber

          public void writeNumber(int i)
                           throws IOException

      Specified by:
        `writeNumber` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeNumber

          public void writeNumber(long l)
                           throws IOException

      Specified by:
        `writeNumber` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeNumber

          public void writeNumber(BigInteger v)
                           throws IOException

      Specified by:
        `writeNumber` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeNumber

          public void writeNumber(double d)
                           throws IOException

      Specified by:
        `writeNumber` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeNumber

          public void writeNumber(float f)
                           throws IOException

      Specified by:
        `writeNumber` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeNumber

          public void writeNumber(BigDecimal dec)
                           throws IOException

      Specified by:
        `writeNumber` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### writeNumber

          public void writeNumber(String encodedValue)
                           throws IOException

      Specified by:
        `writeNumber` in class `com.fasterxml.jackson.core.JsonGenerator`
      Throws:
        `IOException`

    - #### _verifyValueWrite

          protected final void _verifyValueWrite(String typeMsg)
                                          throws IOException

      Specified by:
        `_verifyValueWrite` in class `com.fasterxml.jackson.core.base.GeneratorBase`
      Throws:
        `IOException`

    - #### _releaseBuffers

          protected void _releaseBuffers()

      Specified by:
        `_releaseBuffers` in class `com.fasterxml.jackson.core.base.GeneratorBase`

    - #### _complete

          protected void _complete()
                            throws IOException

      Throws:
        `IOException`

Copyright © 2016 FasterXML. All rights reserved.