use of de.metas.ui.web.window.exceptions.DocumentFieldReadonlyException in project metasfresh-webui-api by metasfresh.
the class HUEditorRowAttributes method processChange.
private void processChange(final JSONDocumentChangedEvent event) {
if (JSONDocumentChangedEvent.JSONOperation.replace == event.getOperation()) {
final String attributeName = event.getPath();
if (isReadonly(attributeName)) {
throw new DocumentFieldReadonlyException(attributeName, event.getValue());
}
final I_M_Attribute attribute = attributesStorage.getAttributeByValueKeyOrNull(attributeName);
final Object value = convertFromJson(attribute, event.getValue());
attributesStorage.setValue(attribute, value);
} else {
throw new IllegalArgumentException("Unknown operation: " + event);
}
}
Aggregations