|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avro.reflect.ReflectData
public class ReflectData
Utilities to use existing Java classes and interfaces via reflection.
Method Summary | |
---|---|
static Protocol |
getProtocol(Class iface)
Generate a protocol for a Java interface. |
static Schema |
getSchema(Type type)
Generate a schema for a Java type. |
static boolean |
validate(Schema schema,
Object datum)
Returns true if an object matches a schema. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean validate(Schema schema, Object datum)
public static Schema getSchema(Type type)
For records, declared fields
(not
inherited) which are not static or transient are used.
Note that unions cannot be automatically generated by this method, since Java provides no representation for unions.
public static Protocol getProtocol(Class iface)
Note that this requires that Paranamer is run over compiled interface declarations, since Java 6 reflection does not provide access to method parameter names. See Avro's build.xml for an example.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |