use of com.tvd12.dahlia.core.setting.FieldObjectSetting in project dahlia by youngmonkeys.
the class LocalCollectionSettingReader method readFieldObjectSetting.
protected FieldSetting readFieldObjectSetting(JSONObject setting) {
FieldObjectSetting field = new FieldObjectSetting();
if (setting.has(SettingFields.FIELDS)) {
JSONObject fieldSettings = setting.getJSONObject(SettingFields.FIELDS);
Map<String, FieldSetting> fields = readFieldSettings(fieldSettings);
field.setFields(fields);
} else {
throw new IllegalArgumentException("'fields' is required");
}
return field;
}
use of com.tvd12.dahlia.core.setting.FieldObjectSetting in project dahlia by youngmonkeys.
the class FieldObjectWriter method writeValue.
@Override
protected void writeValue(FieldWriters writers, FileProxy file, FieldSetting setting, EzyObject value) throws IOException {
FieldObjectSetting fs = (FieldObjectSetting) setting;
Map<String, FieldSetting> fieldSettings = fs.getFields();
writers.write(file, fieldSettings, value);
}
use of com.tvd12.dahlia.core.setting.FieldObjectSetting in project dahlia by youngmonkeys.
the class SettingObjectToObjectField method newSetting.
@Override
protected FieldObjectSetting newSetting(SettingObjectToFields mappers, EzyObject object) {
FieldObjectSetting setting = new FieldObjectSetting();
EzyArray fieldSettings = object.get(SettingFields.FIELDS, EzyArray.class);
Map<String, FieldSetting> fields = mappers.toFieldSettings(fieldSettings);
setting.setFields(fields);
return setting;
}
use of com.tvd12.dahlia.core.setting.FieldObjectSetting in project dahlia by youngmonkeys.
the class FieldObjectReader method readValue.
@Override
protected EzyObject readValue(FieldReaders readers, FileProxy file, FieldSetting setting) throws IOException {
FieldObjectSetting fs = (FieldObjectSetting) setting;
Map<String, FieldSetting> fieldSettings = fs.getFields();
EzyObject object = EzyEntityFactory.newObject();
readers.read(file, fieldSettings, object);
return object;
}
Aggregations