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.
|
This API is not recommended except as a stepping stone for
systems that currently uses Java interfaces to define RPC protocols.
For new RPC systems, the specific
API
is preferred. For systems that process dynamic data, the generic
API is probably best.
Java types are mapped to Avro schemas as follows:
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.Union
annotation can be used
to support reflection of schemas for interfaces, abstract base classes
and other uses of polymorphism.Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.