Skip navigation links

Package org.apache.avro.reflect

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

See: Description

Package org.apache.avro.reflect Description

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.

Skip navigation links

Copyright © 2009–2022 The Apache Software Foundation. All rights reserved.