See: Description
| Class | Description |
|---|---|
| ReflectData |
Utilities to use existing Java classes and interfaces via reflection.
|
| ReflectData.AllowNull |
ReflectData implementation that permits null field values. |
| ReflectDatumReader<T> |
DatumReader for existing classes via
Java reflection. |
| ReflectDatumWriter<T> |
DatumWriter for existing classes
via Java reflection. |
| Annotation Type | Description |
|---|---|
| Nullable |
Declares that null is a valid value for a Java type.
|
| Stringable |
Declares that a class should be represented by an Avro string.
|
| Union |
Declares that a Java type should be represented by an Avro union schema.
|
Java types are mapped to Avro schemas as follows:
Nullable or a Union containing null.Union annotation, the "java-element"
property is set to the union's class, e.g.:
{"type": "array", "java-element": "org.acme.Foo"}
{"type": "array", "java-class": "java.util.ArrayList"}
String is mapped to an Avro string schema.{"type": "int", "java-class": "java.lang.Short"}
generic API.The Union annotation can be used
to support reflection of schemas for interfaces, abstract base classes
and other uses of polymorphism.
The Stringable annotation
will cause a type to be serialized via its toString method.
Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.