for (Object o : list)
{
boolean ok = true;
if (o instanceof DataMap)
{
DataMap fieldMap = (DataMap) o;
String name = getString(fieldMap, NAME_KEY, true);
DataSchema type = getSchemaData(fieldMap, TYPE_KEY);
String doc = getString(fieldMap, DOC_KEY, false);
Boolean optional = getBoolean(fieldMap, OPTIONAL_KEY, false);
RecordDataSchema.Field.Order sortOrder = null;
String order = getString(fieldMap, ORDER_KEY, false);
if (order != null)
{
try
{
sortOrder = RecordDataSchema.Field.Order.valueOf(order.toUpperCase());
}
catch (IllegalArgumentException exc)
{
startErrorMessage(order).append("\"").append(order).append("\" is an invalid sort order.\n");
}
}
Map<String, Object> properties = extractProperties(fieldMap, FIELD_KEYS);
List<String> aliases = getStringList(fieldMap, ALIASES_KEY, false);
if (name != null && type != null)
{
RecordDataSchema.Field field = new RecordDataSchema.Field(type);
field.setDefault(fieldMap.get(DEFAULT_KEY));
if (doc != null)
{
field.setDoc(doc);
}
field.setName(name, startCalleeMessageBuilder());