|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
---|---|
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 Types Summary | |
---|---|
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. |
Use Java reflection to generate schemas and protocols for existing classes.
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.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |