/** Create a schema for a field. */ protected Schema createFieldSchema(Field field, Map<String, Schema> names) { AvroEncode enc = field.getAnnotation(AvroEncode.class); if (enc != null) try { return enc.using().newInstance().getSchema(); } catch (Exception e) { throw new AvroRuntimeException("Could not create schema from custom serializer for " + field.getName()); } AvroSchema explicit = field.getAnnotation(AvroSchema.class); if (explicit != null) // explicit schema return Schema.parse(explicit.value()); Union union = field.getAnnotation(Union.class); if (union != null) return getAnnotatedUnion(union, names); Schema schema = createSchema(field.getGenericType(), names); if (field.isAnnotationPresent(Stringable.class)) { // Stringable schema = Schema.create(Schema.Type.STRING); } if (field.isAnnotationPresent(Nullable.class)) // nullable schema = makeNullable(schema); return schema; }
paramSchema = Schema.parse(((AvroSchema)annotation).value()); else if (annotation instanceof Union) // union paramSchema = getAnnotatedUnion(((Union)annotation), names); else if (annotation instanceof Nullable) // nullable paramSchema = makeNullable(paramSchema); Schema response = union == null ? getSchema(method.getGenericReturnType(), names) : getAnnotatedUnion(union, names); if (method.isAnnotationPresent(Nullable.class)) // nullable response = makeNullable(response);
paramSchema = Schema.parse(((AvroSchema)annotation).value()); else if (annotation instanceof Union) // union paramSchema = getAnnotatedUnion(((Union)annotation), names); else if (annotation instanceof Nullable) // nullable paramSchema = makeNullable(paramSchema); Schema response = union == null ? getSchema(method.getGenericReturnType(), names) : getAnnotatedUnion(union, names); if (method.isAnnotationPresent(Nullable.class)) // nullable response = makeNullable(response);
Union union = c.getAnnotation(Union.class); if (union != null) { // union annotated return getAnnotatedUnion(union, names); } else if (isStringable(c)) { // Stringable Schema result = Schema.create(Schema.Type.STRING);
Union union = c.getAnnotation(Union.class); if (union != null) { // union annotated return getAnnotatedUnion(union, names); } else if (isStringable(c)) { // Stringable Schema result = Schema.create(Schema.Type.STRING);
for (int j = 0; j < annotations[i].length; j++) if (annotations[i][j] instanceof Union) paramSchema = getAnnotatedUnion(((Union)annotations[i][j]), names); else if (annotations[i][j] instanceof Nullable) paramSchema = makeNullable(paramSchema); Schema response = union == null ? getSchema(method.getGenericReturnType(), names) : getAnnotatedUnion(union, names); if (method.isAnnotationPresent(Nullable.class)) // nullable response = makeNullable(response);
for (int j = 0; j < annotations[i].length; j++) if (annotations[i][j] instanceof Union) paramSchema = getAnnotatedUnion(((Union)annotations[i][j]), names); else if (annotations[i][j] instanceof Nullable) paramSchema = makeNullable(paramSchema); Schema response = union == null ? getSchema(method.getGenericReturnType(), names) : getAnnotatedUnion(union, names); if (method.isAnnotationPresent(Nullable.class)) // nullable response = makeNullable(response);
for (int j = 0; j < annotations[i].length; j++) if (annotations[i][j] instanceof Union) paramSchema = getAnnotatedUnion(((Union)annotations[i][j]), names); else if (annotations[i][j] instanceof Nullable) paramSchema = makeNullable(paramSchema); Schema response = union == null ? getSchema(method.getGenericReturnType(), names) : getAnnotatedUnion(union, names); if (method.isAnnotationPresent(Nullable.class)) // nullable response = makeNullable(response);
paramSchema = Schema.parse(((AvroSchema)annotation).value()); else if (annotation instanceof Union) // union paramSchema = getAnnotatedUnion(((Union)annotation), names); else if (annotation instanceof Nullable) // nullable paramSchema = makeNullable(paramSchema); Schema response = union == null ? getSchema(method.getGenericReturnType(), names) : getAnnotatedUnion(union, names); if (method.isAnnotationPresent(Nullable.class)) // nullable response = makeNullable(response);
Union union = c.getAnnotation(Union.class); if (union != null) { // union annotated return getAnnotatedUnion(union, names); } else if (c.isAnnotationPresent(Stringable.class)){ // Stringable Schema result = Schema.create(Schema.Type.STRING);
Union union = c.getAnnotation(Union.class); if (union != null) { // union annotated return getAnnotatedUnion(union, names); } else if (c.isAnnotationPresent(Stringable.class)){ // Stringable Schema result = Schema.create(Schema.Type.STRING);
Union union = c.getAnnotation(Union.class); if (union != null) { // union annotated return getAnnotatedUnion(union, names); } else if (isStringable(c)) { // Stringable Schema result = Schema.create(Schema.Type.STRING);
Union union = c.getAnnotation(Union.class); if (union != null) { // union annotated return getAnnotatedUnion(union, names); } else if (isStringable(c)) { // Stringable Schema result = Schema.create(Schema.Type.STRING);