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
DatumWriter
for generated Java
classes.-
Constructor Summary
ModifierConstructorDescriptionSpecificDatumWriter
(Schema schema) SpecificDatumWriter
(Schema root, SpecificData specificData) protected
SpecificDatumWriter
(SpecificData specificData) -
Method Summary
Modifier and TypeMethodDescriptionReturns theSpecificData
implementation used by this writer.protected void
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
-
Constructor Details
-
SpecificDatumWriter
public SpecificDatumWriter() -
SpecificDatumWriter
-
SpecificDatumWriter
-
SpecificDatumWriter
-
SpecificDatumWriter
-
-
Method Details
-
getSpecificData
Returns theSpecificData
implementation used by this writer. -
writeEnum
Description copied from class:GenericDatumWriter
Called to write an enum value. May be overridden for alternate enum representations.- Overrides:
writeEnum
in classGenericDatumWriter<T>
- Throws:
IOException
-
writeString
Description copied from class:GenericDatumWriter
Called to write a string. May be overridden for alternate string representations.- Overrides:
writeString
in classGenericDatumWriter<T>
- Throws:
IOException
-
writeRecord
Description copied from class:GenericDatumWriter
Called to write a record. May be overridden for alternate record representations.- Overrides:
writeRecord
in classGenericDatumWriter<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 classGenericDatumWriter<T>
- Throws:
IOException
-