com.fasterxml.jackson.dataformat.avro.ser

## Class MapWriteContext

- java.lang.Object
- - com.fasterxml.jackson.core.JsonStreamContext
  - - com.fasterxml.jackson.dataformat.avro.ser.AvroWriteContext
    - - com.fasterxml.jackson.dataformat.avro.ser.MapWriteContext

-     public final class MapWriteContext
      extends AvroWriteContext

  Alternative to `ObjectWriteContext` that needs to be used with Avro Map datatype.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `_currentName`
    `protected Map<String,Object>` | `_data`
    `protected boolean` | `_expectValue`

    - ### Fields inherited from class com.fasterxml.jackson.dataformat.avro.ser.AvroWriteContext

      `_currentValue, _generator, _parent, _schema`

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

      `_index, _type, TYPE_ARRAY, TYPE_OBJECT, TYPE_ROOT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapWriteContext(AvroWriteContext parent, AvroGenerator generator, org.apache.avro.Schema schema)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `_verifyValueWrite()`
    `void` | `appendDesc(StringBuilder sb)`
    `boolean` | `canClose()`
    `AvroWriteContext` | `createChildArrayContext()`
    `AvroWriteContext` | `createChildObjectContext()`
    `String` | `getCurrentName()`
    `Object` | `rawValue()` Accessor called to link data being built with resulting object.
    `boolean` | `writeFieldName(String name)` Method that writer is to call before it writes a field name.
    `void` | `writeNull()`
    `void` | `writeString(String value)`
    `void` | `writeValue(Object value)`

    - ### Methods inherited from class com.fasterxml.jackson.dataformat.avro.ser.AvroWriteContext

      `_createArray, _createObjectContext, _createObjectContext, _createRecord, _recordOrMapFromUnion, complete, createChildObjectContext, createRootContext, getCurrentValue, getParent, nullContext, resolveUnionIndex, resolveUnionSchema, resolveUnionType, setCurrentValue, toString`

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

      `getCurrentIndex, getEntryCount, getStartLocation, getTypeDesc, hasCurrentIndex, hasCurrentName, hasPathSegment, inArray, inObject, inRoot, pathAsPointer, pathAsPointer, typeDesc`

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

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

- - ### Field Detail

    - #### _data

          protected final Map<String,Object> _data

    - #### _currentName

          protected String _currentName

    - #### _expectValue

          protected boolean _expectValue

  - ### Constructor Detail

    - #### MapWriteContext

          public MapWriteContext(AvroWriteContext parent,
                         AvroGenerator generator,
                         org.apache.avro.Schema schema)

  - ### Method Detail

    - #### rawValue

          public Object rawValue()

      Description copied from class: `AvroWriteContext`
      Accessor called to link data being built with resulting object.
      Specified by:
        `rawValue` in class `AvroWriteContext`

    - #### writeFieldName

          public final boolean writeFieldName(String name)

      Description copied from class: `AvroWriteContext`
      Method that writer is to call before it writes a field name.
      Overrides:
        `writeFieldName` in class `AvroWriteContext`
      Returns:
        True if writing succeeded (for `ObjectWriteContext`, iff column was recognized)

    - #### createChildArrayContext

          public final AvroWriteContext createChildArrayContext()

      Specified by:
        `createChildArrayContext` in class `AvroWriteContext`

    - #### createChildObjectContext

          public final AvroWriteContext createChildObjectContext()
                                                          throws com.fasterxml.jackson.databind.JsonMappingException

      Specified by:
        `createChildObjectContext` in class `AvroWriteContext`
      Throws:
        `com.fasterxml.jackson.databind.JsonMappingException`

    - #### writeValue

          public void writeValue(Object value)

      Specified by:
        `writeValue` in class `AvroWriteContext`

    - #### writeString

          public void writeString(String value)

      Specified by:
        `writeString` in class `AvroWriteContext`

    - #### writeNull

          public void writeNull()

      Specified by:
        `writeNull` in class `AvroWriteContext`

    - #### _verifyValueWrite

          protected final void _verifyValueWrite()

    - #### getCurrentName

          public final String getCurrentName()

      Overrides:
        `getCurrentName` in class `AvroWriteContext`

    - #### canClose

          public boolean canClose()

      Overrides:
        `canClose` in class `AvroWriteContext`

    - #### appendDesc

          public final void appendDesc(StringBuilder sb)

      Specified by:
        `appendDesc` in class `AvroWriteContext`

Copyright © 2017 FasterXML. All rights reserved.