org.apache.avro.reflect
Class ReflectDatumWriter
java.lang.Object
org.apache.avro.generic.GenericDatumWriter<Object>
org.apache.avro.reflect.ReflectDatumWriter
- All Implemented Interfaces:
- DatumWriter<Object>
- Direct Known Subclasses:
- SpecificDatumWriter
public class ReflectDatumWriter
- extends GenericDatumWriter<Object>
DatumWriter
for existing classes
via Java reflection.
Methods inherited from class org.apache.avro.generic.GenericDatumWriter |
getArrayElements, getArraySize, getMapEntries, getMapSize, setSchema, write, write, writeArray, writeBytes, writeFixed, writeMap, writeRecord, writeString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReflectDatumWriter
public ReflectDatumWriter()
ReflectDatumWriter
public ReflectDatumWriter(Schema root)
ReflectDatumWriter
public ReflectDatumWriter(Schema root,
ReflectData reflectData)
ReflectDatumWriter
public ReflectDatumWriter(ReflectData reflectData)
getField
protected Object getField(Object record,
String name,
int position)
- Description copied from class:
GenericDatumWriter
- Called by the default implementation of
GenericDatumWriter.writeRecord(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder)
to retrieve
a record field value. The default implementation is for GenericRecord
.
- Overrides:
getField
in class GenericDatumWriter<Object>
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<Object>
- Throws:
IOException
isEnum
protected boolean isEnum(Object datum)
Copyright © 2009 The Apache Software Foundation