Package org.apache.avro.reflect
Class ReflectDatumWriter<T>
java.lang.Object
org.apache.avro.generic.GenericDatumWriter<T>
org.apache.avro.specific.SpecificDatumWriter<T>
org.apache.avro.reflect.ReflectDatumWriter<T>
- All Implemented Interfaces:
DatumWriter<T>
DatumWriter
for existing classes via
Java reflection.-
Constructor Summary
ModifierConstructorDescriptionReflectDatumWriter
(Class<T> c) ReflectDatumWriter
(Class<T> c, ReflectData data) protected
ReflectDatumWriter
(ReflectData reflectData) ReflectDatumWriter
(Schema root) ReflectDatumWriter
(Schema root, ReflectData reflectData) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Called to write data.protected void
writeArray
(Schema schema, Object datum, Encoder out) Called to write a array.protected void
writeBytes
(Object datum, Encoder out) Called to write a bytes.protected void
writeField
(Object record, Schema.Field f, Encoder out, Object state) Called to write a single field of a record.Methods inherited from class org.apache.avro.specific.SpecificDatumWriter
getSpecificData, writeEnum, writeRecord, writeString
Methods inherited from class org.apache.avro.generic.GenericDatumWriter
addAvroTypeMsg, addClassCastMsg, convert, getArrayElements, getArraySize, getData, getMapEntries, getMapSize, npe, resolveUnion, setSchema, write, writeFixed, writeMap, writeString, writeWithoutConversion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.avro.io.DatumWriter
toByteArray
-
Constructor Details
-
ReflectDatumWriter
public ReflectDatumWriter() -
ReflectDatumWriter
-
ReflectDatumWriter
-
ReflectDatumWriter
-
ReflectDatumWriter
-
ReflectDatumWriter
-
-
Method Details
-
writeArray
Called to write a array. May be overridden for alternate array representations.- Overrides:
writeArray
in classGenericDatumWriter<T>
- Throws:
IOException
-
writeBytes
Description copied from class:GenericDatumWriter
Called to write a bytes. May be overridden for alternate bytes representations.- Overrides:
writeBytes
in classGenericDatumWriter<T>
- Throws:
IOException
-
write
Description copied from class:GenericDatumWriter
Called to write data.- Overrides:
write
in classGenericDatumWriter<T>
- Throws:
IOException
-
writeField
protected void writeField(Object record, 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 classSpecificDatumWriter<T>
- Throws:
IOException
-