Package org.apache.avro.specific

# Class SpecificDatumWriter<T>

java.lang.Object
org.apache.avro.generic.GenericDatumWriter<T>
org.apache.avro.specific.SpecificDatumWriter<T>

All Implemented Interfaces:
  `DatumWriter<T>`

Direct Known Subclasses:
  `ReflectDatumWriter`

public class SpecificDatumWriter<T> extends GenericDatumWriter<T>
`DatumWriter` for generated Java classes.

## Constructor Summary

Constructors
Modifier
Constructor
Description
``
`SpecificDatumWriter()`
``
`SpecificDatumWriter(Class<T> c)`
``
`SpecificDatumWriter(Schema schema)`
``
`SpecificDatumWriter(Schema root, SpecificData specificData)`
`protected`
`SpecificDatumWriter(SpecificData specificData)`

## Method Summary

Modifier and Type
Method
Description
`SpecificData`
`getSpecificData()`
Returns the `SpecificData` implementation used by this writer.
`protected void`
`writeEnum(Schema schema, Object datum, Encoder out)`
Called to write an enum value.
`protected void`
`writeField(Object datum, Schema.Field f, Encoder out, Object state)`
Called to write a single field of a record.
`protected void`
`writeRecord(Schema schema, Object datum, Encoder out)`
Called to write a record.
`protected void`
`writeString(Schema schema, Object datum, Encoder out)`
Called to write a string.

### Methods inherited from class org.apache.avro.generic.GenericDatumWriter

`addAvroTypeMsg, addClassCastMsg, convert, getArrayElements, getArraySize, getData, getMapEntries, getMapSize, npe, resolveUnion, setSchema, write, write, writeArray, writeBytes, writeFixed, writeMap, writeString, writeWithoutConversion`

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

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

## Constructor Details

### SpecificDatumWriter

public SpecificDatumWriter()

### SpecificDatumWriter

public SpecificDatumWriter(Class<T> c)

### SpecificDatumWriter

public SpecificDatumWriter(Schema schema)

### SpecificDatumWriter

public SpecificDatumWriter(Schema root, SpecificData specificData)

### SpecificDatumWriter

protected SpecificDatumWriter(SpecificData specificData)

## Method Details

### getSpecificData

public SpecificData getSpecificData()
Returns the `SpecificData` implementation used by this writer.

### writeEnum

protected void writeEnum(Schema schema, Object datum, Encoder out) throws IOException
Description copied from class: `GenericDatumWriter`
Called to write an enum value. May be overridden for alternate enum representations.

Overrides:
  `writeEnum` in class `GenericDatumWriter<T>`
Throws:
  `IOException`

### writeString

protected void writeString(Schema schema, Object datum, Encoder out) throws IOException
Description copied from class: `GenericDatumWriter`
Called to write a string. May be overridden for alternate string representations.

Overrides:
  `writeString` in class `GenericDatumWriter<T>`
Throws:
  `IOException`

### writeRecord

protected void writeRecord(Schema schema, Object datum, Encoder out) throws IOException
Description copied from class: `GenericDatumWriter`
Called to write a record. May be overridden for alternate record representations.

Overrides:
  `writeRecord` in class `GenericDatumWriter<T>`
Throws:
  `IOException`

### writeField

protected void writeField(Object datum, Schema.Field f, Encoder out, Object state) throws IOException
Description copied from class: `GenericDatumWriter`
Called to write a single field of a record. May be overridden for more efficient or alternate implementations.

Overrides:
  `writeField` in class `GenericDatumWriter<T>`
Throws:
  `IOException`