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
ConstructorsModifierConstructorDescriptionSpecificDatumWriter(Schema schema) SpecificDatumWriter(Schema root, SpecificData specificData) protectedSpecificDatumWriter(SpecificData specificData) -
Method Summary
Modifier and TypeMethodDescriptionReturns theSpecificDataimplementation used by this writer.protected voidCalled to write an enum value.protected voidwriteField(Object datum, Schema.Field f, Encoder out, Object state) Called to write a single field of a record.protected voidwriteRecord(Schema schema, Object datum, Encoder out) Called to write a record.protected voidwriteString(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, writeWithoutConversionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.avro.io.DatumWriter
toByteArray
-
Constructor Details
-
SpecificDatumWriter
public SpecificDatumWriter() -
SpecificDatumWriter
-
SpecificDatumWriter
-
SpecificDatumWriter
-
SpecificDatumWriter
-
-
Method Details
-
getSpecificData
Returns theSpecificDataimplementation used by this writer. -
writeEnum
Description copied from class:GenericDatumWriterCalled to write an enum value. May be overridden for alternate enum representations.- Overrides:
writeEnumin classGenericDatumWriter<T>- Throws:
IOException
-
writeString
Description copied from class:GenericDatumWriterCalled to write a string. May be overridden for alternate string representations.- Overrides:
writeStringin classGenericDatumWriter<T>- Throws:
IOException
-
writeRecord
Description copied from class:GenericDatumWriterCalled to write a record. May be overridden for alternate record representations.- Overrides:
writeRecordin classGenericDatumWriter<T>- Throws:
IOException
-
writeField
protected void writeField(Object datum, Schema.Field f, Encoder out, Object state) throws IOException Description copied from class:GenericDatumWriterCalled to write a single field of a record. May be overridden for more efficient or alternate implementations.- Overrides:
writeFieldin classGenericDatumWriter<T>- Throws:
IOException
-