|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avro.generic.GenericDatumReader<T> org.apache.avro.specific.SpecificDatumReader<T> org.apache.avro.reflect.ReflectDatumReader<T>
public class ReflectDatumReader<T>
DatumReader
for existing classes via
Java reflection.
Constructor Summary | |
---|---|
ReflectDatumReader()
|
|
ReflectDatumReader(Class<T> c)
|
|
ReflectDatumReader(Schema root)
|
Method Summary | |
---|---|
protected void |
addToArray(Object array,
long pos,
Object e)
Called by the default implementation of GenericDatumReader.readArray(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder) to add a value. |
protected Object |
createString(String value)
Called to create a string from a default value. |
protected Object |
getField(Object record,
String name,
int position)
Called by the default implementation of GenericDatumReader.readRecord(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder) to retrieve a
record field value from a reused instance. |
protected Object |
newArray(Object old,
int size,
Schema schema)
Called to create new array instances. |
protected Object |
peekArray(Object array)
Called by the default implementation of GenericDatumReader.readArray(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder) to retrieve a
value from a reused instance. |
protected Object |
readBytes(Object old,
Decoder in)
Called to read byte arrays. |
protected Object |
readInt(Object old,
Schema expected,
Decoder in)
Called to read integers. |
protected Object |
readString(Object old,
Decoder in)
Called to read strings. |
protected Object |
readString(Object old,
Schema s,
Decoder in)
Called to read strings. |
protected void |
setField(Object record,
String name,
int position,
Object o)
Called by the default implementation of GenericDatumReader.readRecord(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder) to set a
record fields value to a record instance. |
Methods inherited from class org.apache.avro.specific.SpecificDatumReader |
---|
createEnum, createFixed, newInstance, newRecord |
Methods inherited from class org.apache.avro.generic.GenericDatumReader |
---|
addToMap, createBytes, createFixed, newMap, read, read, readArray, readEnum, readFixed, readMap, readRecord, removeField, setExpected, setSchema, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReflectDatumReader()
public ReflectDatumReader(Class<T> c)
public ReflectDatumReader(Schema root)
Method Detail |
---|
protected void setField(Object record, String name, int position, Object o)
GenericDatumReader
GenericDatumReader.readRecord(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder)
to set a
record fields value to a record instance. The default implementation is
for IndexedRecord
.
setField
in class SpecificDatumReader<T>
protected Object getField(Object record, String name, int position)
GenericDatumReader
GenericDatumReader.readRecord(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder)
to retrieve a
record field value from a reused instance. The default implementation is
for IndexedRecord
.
getField
in class SpecificDatumReader<T>
protected Object newArray(Object old, int size, Schema schema)
GenericDatumReader
GenericData.Array
.
newArray
in class GenericDatumReader<T>
protected Object peekArray(Object array)
GenericDatumReader
GenericDatumReader.readArray(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder)
to retrieve a
value from a reused instance. The default implementation is for GenericArray
.
peekArray
in class GenericDatumReader<T>
protected void addToArray(Object array, long pos, Object e)
GenericDatumReader
GenericDatumReader.readArray(java.lang.Object, org.apache.avro.Schema, org.apache.avro.io.ResolvingDecoder)
to add a value.
The default implementation is for GenericArray
.
addToArray
in class GenericDatumReader<T>
protected Object readString(Object old, Schema s, Decoder in) throws IOException
GenericDatumReader
GenericDatumReader.readString(Object,Decoder)
.
readString
in class GenericDatumReader<T>
IOException
protected Object readString(Object old, Decoder in) throws IOException
GenericDatumReader
Decoder.readString(Utf8)
.
readString
in class GenericDatumReader<T>
IOException
protected Object createString(String value)
GenericDatumReader
Utf8.Utf8(String)
.
createString
in class GenericDatumReader<T>
protected Object readBytes(Object old, Decoder in) throws IOException
GenericDatumReader
Decoder.readBytes(ByteBuffer)
.
readBytes
in class GenericDatumReader<T>
IOException
protected Object readInt(Object old, Schema expected, Decoder in) throws IOException
GenericDatumReader
Decoder.readInt()
.
readInt
in class GenericDatumReader<T>
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |