use of com.walmartlabs.concord.project.yaml.model.YamlFormField in project concord by walmartlabs.
the class YamlFormConverter method convert.
public static FormDefinition convert(String name, List<YamlFormField> fields) throws YamlConverterException {
Map<String, Object> options = null;
List<FormField> l = new ArrayList<>();
for (YamlFormField f : fields) {
if (f == null || f.getName() == null) {
throw new YamlConverterException("Empty field definition in form '" + name + "'");
}
if (OPTIONS_FIELD_NAME.equals(f.getName())) {
if (options != null) {
throw new YamlConverterException("Duplicate options definition in form '" + name + "'");
}
options = f.getOptions();
continue;
}
l.add(convert(f));
}
return new FormDefinition(name, l);
}
Aggregations