/** 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()); 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; }
/** 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 = getAnnotatedUnion(((Union)annotation), names); else if (annotation instanceof Nullable) // nullable paramSchema = makeNullable(paramSchema); : getAnnotatedUnion(union, names); if (method.isAnnotationPresent(Nullable.class)) // nullable response = makeNullable(response);
paramSchema = getAnnotatedUnion(((Union)annotation), names); else if (annotation instanceof Nullable) // nullable paramSchema = makeNullable(paramSchema); : getAnnotatedUnion(union, names); if (method.isAnnotationPresent(Nullable.class)) // nullable response = makeNullable(response);
/** Create a schema for a field. */ protected Schema createFieldSchema(Field field, Map<String, Schema> names) { Schema schema = createSchema(field.getGenericType(), names); if (field.isAnnotationPresent(Nullable.class)) // nullable schema = makeNullable(schema); return schema; }
/** Create a schema for a field. */ protected Schema createFieldSchema(Field field, Map<String, Schema> names) { Schema schema = createSchema(field.getGenericType(), names); if (field.isAnnotationPresent(Nullable.class)) // nullable schema = makeNullable(schema); return schema; }
/** 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()); } 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; }
/** 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()); 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 = getAnnotatedUnion(((Union)annotations[i][j]), names); else if (annotations[i][j] instanceof Nullable) paramSchema = makeNullable(paramSchema); String paramName = paramNames.length == paramTypes.length ? paramNames[i] : getAnnotatedUnion(union, names); if (method.isAnnotationPresent(Nullable.class)) // nullable response = makeNullable(response);
paramSchema = getAnnotatedUnion(((Union)annotations[i][j]), names); else if (annotations[i][j] instanceof Nullable) paramSchema = makeNullable(paramSchema); String paramName = paramNames.length == paramTypes.length ? paramNames[i] : getAnnotatedUnion(union, names); if (method.isAnnotationPresent(Nullable.class)) // nullable response = makeNullable(response);
paramSchema = getAnnotatedUnion(((Union)annotations[i][j]), names); else if (annotations[i][j] instanceof Nullable) paramSchema = makeNullable(paramSchema); String paramName = paramNames.length == paramTypes.length ? paramNames[i] : getAnnotatedUnion(union, names); if (method.isAnnotationPresent(Nullable.class)) // nullable response = makeNullable(response);
paramSchema = getAnnotatedUnion(((Union)annotation), names); else if (annotation instanceof Nullable) // nullable paramSchema = makeNullable(paramSchema); : getAnnotatedUnion(union, names); if (method.isAnnotationPresent(Nullable.class)) // nullable response = makeNullable(response);