use of org.activityinfo.store.hrd.FieldConverter in project activityinfo by bedatadriven.
the class FormRecordEntity method setFieldValues.
public void setFieldValues(FormClass formClass, Map<ResourceId, FieldValue> values) {
if (fieldValues == null) {
fieldValues = new EmbeddedEntity();
}
for (FormField field : formClass.getFields()) {
if (values.containsKey(field.getId())) {
FieldValue value = values.get(field.getId());
if (value == null) {
fieldValues.removeProperty(field.getName());
} else {
FieldConverter converter = FieldConverters.forType(field.getType());
fieldValues.setUnindexedProperty(field.getName(), converter.toHrdProperty(value));
}
}
}
}
Aggregations