DatumWriter for generic Java objects.
| Modifier and Type | Field and Description |
|---|---|
| private final GenericData | |
| private Schema |
| Access | Constructor and Description |
|---|---|
| public | |
| protected | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected AvroTypeException | addAvroTypeMsg(AvroTypeException e, String s)
Helper method for adding a message to an Avro Type Exception . |
| protected ClassCastException | addClassCastMsg(ClassCastException e, String s)
Helper method for adding a message to an Class Cast Exception . |
| protected <T> Object | convert(Schema schema, LogicalType logicalType, Conversion<T> conversion, Object datum)
Convert a high level representation of a logical type (such as a BigDecimal) to its underlying representation object (such as a ByteBuffer). |
| private void | |
| protected Iterator | getArrayElements(Object array)
Called by the default implementation of |
| protected long | getArraySize(Object array)
Called by the default implementation of |
| public GenericData | |
| protected Iterable | getMapEntries(Object map)
Called by the default implementation of |
| protected int | |
| protected NullPointerException | |
| protected int | |
| public void | |
| public void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void |
| data | back to summary |
|---|---|
| private final GenericData data | |
| root | back to summary |
|---|---|
| private Schema root | |
| GenericDatumWriter | back to summary |
|---|---|
| public GenericDatumWriter() | |
| GenericDatumWriter | back to summary |
|---|---|
| protected GenericDatumWriter(GenericData data) | |
| GenericDatumWriter | back to summary |
|---|---|
| public GenericDatumWriter(Schema root) | |
| GenericDatumWriter | back to summary |
|---|---|
| public GenericDatumWriter(Schema root, GenericData data) | |
| addAvroTypeMsg | back to summary |
|---|---|
| protected AvroTypeException addAvroTypeMsg(AvroTypeException e, String s) Helper method for adding a message to an Avro Type Exception . | |
| addClassCastMsg | back to summary |
|---|---|
| protected ClassCastException addClassCastMsg(ClassCastException e, String s) Helper method for adding a message to an Class Cast Exception . | |
| convert | back to summary |
|---|---|
| protected <T> Object convert(Schema schema, LogicalType logicalType, Conversion<T> conversion, Object datum) Convert a high level representation of a logical type (such as a BigDecimal) to its underlying representation object (such as a ByteBuffer).
| |
| error | back to summary |
|---|---|
| private void error(Schema schema, Object datum) | |
| getArrayElements | back to summary |
|---|---|
| protected Iterator Called by the default implementation of | |
| getArraySize | back to summary |
|---|---|
| protected long getArraySize(Object array) Called by the default implementation of | |
| getData | back to summary |
|---|---|
| public GenericData getData() Return the | |
| getMapEntries | back to summary |
|---|---|
| protected Iterable Called by the default implementation of
| |
| getMapSize | back to summary |
|---|---|
| protected int getMapSize(Object map) Called by the default implementation of
| |
| npe | back to summary |
|---|---|
| protected NullPointerException npe(NullPointerException e, String s) Helper method for adding a message to an NPE . | |
| resolveUnion | back to summary |
|---|---|
| protected int resolveUnion(Schema union, Object datum) Called to find the index for a datum within a union. By default calls
| |
| setSchema | back to summary |
|---|---|
| public void setSchema(Schema root) Implements org. Doc from org. Set the schema. | |
| write | back to summary |
|---|---|
| public void write(D datum, Encoder out) throws IOException Implements org. Doc from org. Write a datum. Traverse the schema, depth first, writing each leaf value in the schema from the datum to the output. | |
| write | back to summary |
|---|---|
| protected void write(Schema schema, Object datum, Encoder out) throws IOException Called to write data. | |
| writeArray | back to summary |
|---|---|
| protected void writeArray(Schema schema, Object datum, Encoder out) throws IOException Called to write a array. May be overridden for alternate array representations. | |
| writeBytes | back to summary |
|---|---|
| protected void writeBytes(Object datum, Encoder out) throws IOException Called to write a bytes. May be overridden for alternate bytes representations. | |
| writeEnum | back to summary |
|---|---|
| protected void writeEnum(Schema schema, Object datum, Encoder out) throws IOException Called to write an enum value. May be overridden for alternate enum representations. | |
| writeField | back to summary |
|---|---|
| protected void writeField(Object datum, Schema. Called to write a single field of a record. May be overridden for more efficient or alternate implementations. | |
| writeFixed | back to summary |
|---|---|
| protected void writeFixed(Schema schema, Object datum, Encoder out) throws IOException Called to write a fixed value. May be overridden for alternate fixed representations. | |
| writeMap | back to summary |
|---|---|
| protected void writeMap(Schema schema, Object datum, Encoder out) throws IOException Called to write a map. May be overridden for alternate map representations. | |
| writeRecord | back to summary |
|---|---|
| protected void writeRecord(Schema schema, Object datum, Encoder out) throws IOException Called to write a record. May be overridden for alternate record representations. | |
| writeString | back to summary |
|---|---|
| protected void writeString(Schema schema, Object datum, Encoder out) throws IOException Called to write a string. May be overridden for alternate string representations. | |
| writeString | back to summary |
|---|---|
| protected void writeString(Object datum, Encoder out) throws IOException Called to write a string. May be overridden for alternate string representations. | |
| writeWithoutConversion | back to summary |
|---|---|
| protected void writeWithoutConversion(Schema schema, Object datum, Encoder out) throws IOException Called to write data. | |