use of com.linkedin.avroutil1.model.AvroArraySchema in project avro-util by linkedin.
the class AvscParser method parseCollectionSchema.
private AvroCollectionSchema parseCollectionSchema(JsonObjectExt objectNode, AvscFileParseContext context, AvroType avroType, CodeLocation codeLocation, JsonPropertiesContainer props) {
switch(avroType) {
case ARRAY:
JsonValueExt arrayItemsNode = getRequiredNode(objectNode, "items", () -> "array declarations must have an items property");
SchemaOrRef arrayItemSchema = parseSchemaDeclOrRef(arrayItemsNode, context, false);
return new AvroArraySchema(codeLocation, arrayItemSchema, props);
case MAP:
JsonValueExt mapValuesNode = getRequiredNode(objectNode, "values", () -> "map declarations must have a values property");
SchemaOrRef mapValueSchema = parseSchemaDeclOrRef(mapValuesNode, context, false);
return new AvroMapSchema(codeLocation, mapValueSchema, props);
default:
throw new IllegalStateException("unhandled: " + avroType + " for object at " + codeLocation.getStart());
}
}
Aggregations