|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avro.generic.GenericDatumWriter<D>
public class GenericDatumWriter<D>
DatumWriter
for generic Java objects.
Constructor Summary | |
---|---|
|
GenericDatumWriter()
|
protected |
GenericDatumWriter(GenericData data)
|
|
GenericDatumWriter(Schema root)
|
protected |
GenericDatumWriter(Schema root,
GenericData data)
|
Method Summary | |
---|---|
protected Iterator<? extends Object> |
getArrayElements(Object array)
Called by the default implementation of 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 writeArray(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder) to get the
size of an array. |
GenericData |
getData()
Return the GenericData implementation. |
protected Iterable<Map.Entry<Object,Object>> |
getMapEntries(Object map)
Called by the default implementation of writeMap(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder) to enumerate
map elements. |
protected int |
getMapSize(Object map)
Called by the default implementation of writeMap(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder) to get the size
of a map. |
protected NullPointerException |
npe(NullPointerException e,
String s)
Helper method for adding a message to an NPE. |
void |
setSchema(Schema root)
Set the schema. |
void |
write(D datum,
Encoder out)
Write a datum. |
protected void |
write(Schema schema,
Object datum,
Encoder out)
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 |
writeEnum(Schema schema,
Object datum,
Encoder out)
Called to write an enum value. |
protected void |
writeFixed(Schema schema,
Object datum,
Encoder out)
Called to write a fixed value. |
protected void |
writeMap(Schema schema,
Object datum,
Encoder out)
Called to write a map. |
protected void |
writeRecord(Schema schema,
Object datum,
Encoder out)
Called to write a record. |
protected void |
writeString(Object datum,
Encoder out)
Called to write a string. |
protected void |
writeString(Schema schema,
Object datum,
Encoder out)
Called to write a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericDatumWriter()
protected GenericDatumWriter(GenericData data)
public GenericDatumWriter(Schema root)
protected GenericDatumWriter(Schema root, GenericData data)
Method Detail |
---|
public GenericData getData()
GenericData
implementation.
public void setSchema(Schema root)
DatumWriter
setSchema
in interface DatumWriter<D>
public void write(D datum, Encoder out) throws IOException
DatumWriter
write
in interface DatumWriter<D>
IOException
protected void write(Schema schema, Object datum, Encoder out) throws IOException
IOException
protected NullPointerException npe(NullPointerException e, String s)
protected void writeRecord(Schema schema, Object datum, Encoder out) throws IOException
IOException
protected void writeEnum(Schema schema, Object datum, Encoder out) throws IOException
IOException
protected void writeArray(Schema schema, Object datum, Encoder out) throws IOException
IOException
protected long getArraySize(Object array)
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
.
protected Iterator<? extends Object> getArrayElements(Object array)
writeArray(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder)
to enumerate
array elements. The default implementation is for Collection
.
protected void writeMap(Schema schema, Object datum, Encoder out) throws IOException
IOException
protected int getMapSize(Object map)
writeMap(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder)
to get the size
of a map. The default implementation is for Map
.
protected Iterable<Map.Entry<Object,Object>> getMapEntries(Object map)
writeMap(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder)
to enumerate
map elements. The default implementation is for Map
.
protected void writeString(Schema schema, Object datum, Encoder out) throws IOException
IOException
protected void writeString(Object datum, Encoder out) throws IOException
IOException
protected void writeBytes(Object datum, Encoder out) throws IOException
IOException
protected void writeFixed(Schema schema, Object datum, Encoder out) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |