Top Description Annotations Classes
[default module]

Package org.apache.avro.reflect


Use Java reflection to generate schemas and protocols for existing classes.

Java types are mapped to Avro schemas as follows:

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.

Fields annotated with AvroIgnore will not be written or read to.

The AvroName annotation renames the field in the schema to the given name. The reflect datum reader will look for a schema field with the given name, when trying to read into such an annotated java field.

The AvroMeta annotation adds an arbitrary key:value pair in the schema at the node of the java field.

The AvroSchema annotation forces the use of an custom schema.

The AvroEncode annotation forces the use of an custom encoder. This annotation overrides Stringable and Nullable.

Annotation Summary

Modifier and TypeAnnotation and Description
public @interface
AvroAlias

Adds the given name and space as an alias to the schema.

public @interface
public @interface
AvroDefault

Specifies a default value for a field as a JSON string.

public @interface
AvroDoc

Sets the avrodoc for this java field.

public @interface
AvroEncode

Expert: Fields with this annotation are encoded using the given custom encoder.

public @interface
AvroIgnore

Marks a field as transient.

public @interface
AvroMeta

Adds the given key:Value pair as metadata into the schema, at the corresponding node.

public @interface
AvroName

Sets the avroname for this java field.

public @interface
AvroSchema

Declares that a Java type should have a specified Avro schema, overriding the normally inferred schema.

public @interface
Nullable

Declares that null is a valid value for a Java type.

public @interface
Stringable

Declares that a class or field should be represented by an Avro string.

public @interface
Union

Declares that a Java type should be represented by an Avro union schema.

Class Summary

Modifier and TypeClass and Description
pack-priv class
ArrayAccessor

Helper class to provide native array access whenever possible.

public abstract class
CustomEncoding<
The class of objects that can be serialized with this encoder / decoder.
T
>

Expert: a custom encoder and decoder that writes an object directly to avro.

public class
DateAsLongEncoding

This encoder/decoder writes a java.util.Date object as a long to avro and reads a Date object from long.

pack-priv abstract class
pack-priv abstract class
pack-priv class
pack-priv class
public class
MapEntry<
Key of the map-entry
K
,
Value of the map-entry
V
>

Deprecated Use org.apache.avro.util.MapEntry
Class to make Avro immune from the naming variations of key/value fields among several java.util.Map.Entry implementations.
public class
ReflectData

Utilities to use existing Java classes and interfaces via reflection.

public class
ReflectDatumReader<T>

DatumReader for existing classes via Java reflection.

public class
ReflectDatumWriter<T>

DatumWriter for existing classes via Java reflection.

public class
ReflectionUtil

A few utility methods for using @link{java.misc.Unsafe}, mostly for private use.