public class ReflectDatumWriter<T> extends SpecificDatumWriter<T>
DatumWriter
for existing classes
via Java reflection.Modifier | Constructor and Description |
---|---|
|
ReflectDatumWriter() |
|
ReflectDatumWriter(Class<T> c) |
|
ReflectDatumWriter(Class<T> c,
ReflectData data) |
protected |
ReflectDatumWriter(ReflectData reflectData) |
|
ReflectDatumWriter(Schema root) |
protected |
ReflectDatumWriter(Schema root,
ReflectData reflectData) |
Modifier and Type | Method and Description |
---|---|
protected Iterator<Object> |
getArrayElements(Object array)
Called by the default implementation of
GenericDatumWriter.writeArray(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder) to enumerate
array elements. |
protected long |
getArraySize(Object array)
Called by the default implementation of
GenericDatumWriter.writeArray(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder) to get the
size of an array. |
protected void |
write(Schema schema,
Object datum,
Encoder out)
Called to write data.
|
protected void |
writeBytes(Object datum,
Encoder out)
Called to write a bytes.
|
protected void |
writeString(Schema schema,
Object datum,
Encoder out)
Called to write a string.
|
writeEnum
getData, getMapEntries, getMapSize, npe, resolveUnion, setSchema, write, writeArray, writeFixed, writeMap, writeRecord, writeString
public ReflectDatumWriter()
public ReflectDatumWriter(Class<T> c, ReflectData data)
public ReflectDatumWriter(Schema root)
protected ReflectDatumWriter(Schema root, ReflectData reflectData)
protected ReflectDatumWriter(ReflectData reflectData)
protected long getArraySize(Object array)
GenericDatumWriter
GenericDatumWriter.writeArray(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder)
to get the
size of an array. The default implementation is for Collection
.getArraySize
in class GenericDatumWriter<T>
protected Iterator<Object> getArrayElements(Object array)
GenericDatumWriter
GenericDatumWriter.writeArray(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder)
to enumerate
array elements. The default implementation is for Collection
.getArrayElements
in class GenericDatumWriter<T>
protected void writeString(Schema schema, Object datum, Encoder out) throws IOException
GenericDatumWriter
writeString
in class GenericDatumWriter<T>
IOException
protected void writeBytes(Object datum, Encoder out) throws IOException
GenericDatumWriter
writeBytes
in class GenericDatumWriter<T>
IOException
protected void write(Schema schema, Object datum, Encoder out) throws IOException
GenericDatumWriter
write
in class GenericDatumWriter<T>
IOException
Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.