@Test public void testReadMultiLayerFormForm() { FormReader reader = new FormReader(); FormInstance form = reader.readFromStream(this.getClass().getResourceAsStream("/many-layers-layout-form.json")); assertThat(form).isNotNull(); assertThat(form.getId()).isEqualTo("8548ee2c-5f81-4502-81ba-f649c6dbbd21"); assertThat(form.getName()).isEqualTo("usertaskprocess-taskform.frm"); assertThat(form.getFields()).hasSize(2); FormLayout layout = form.getLayout(); assertThat(layout).isNotNull(); assertThat(layout.getRows()).hasSize(1); LayoutRow row = layout.getRows().get(0); assertThat(row.getColumns()).hasSize(1); LayoutColumn column = row.getColumns().get(0); assertThat(column.getItems()).hasSize(2); }
public FormInstance readFromStream(InputStream formStructure) { try { FormInstance formInstance = this.mapper.readValue(formStructure, FormInstance.class); return flatColumnData(formInstance); } catch (IOException e) { throw new RuntimeException(e); } }
FormReader { public FormInstance readFromStream(InputStream formStructure) { try { FormInstance formInstance = this.mapper.readValue(formStructure, FormInstance.class); return flatColumnData(formInstance); } catch (IOException e) { throw new RuntimeException(e); } } }
FormReader { public FormInstance readFromStream(InputStream formStructure) { try { FormInstance formInstance = this.mapper.readValue(formStructure, FormInstance.class); return flatColumnData(formInstance); } catch (IOException e) { throw new RuntimeException(e); } } FormReader(); }
FormReader { public FormInstance readFromStream(InputStream formStructure) { try { FormInstance formInstance = this.mapper.readValue(formStructure, FormInstance.class); return flatColumnData(formInstance); } catch (IOException e) { throw new RuntimeException(e); } } FormReader(); FormInstance readFromString(String formStructure); FormInstance readFromStream(InputStream formStructure); Map<String, Object> extractValues(Object data); String toJson(Object data); }
FormReader { public FormInstance readFromStream(InputStream formStructure) { try { FormInstance formInstance = this.mapper.readValue(formStructure, FormInstance.class); return flatColumnData(formInstance); } catch (IOException e) { throw new RuntimeException(e); } } FormReader(); FormInstance readFromString(String formStructure); FormInstance readFromStream(InputStream formStructure); Map<String, Object> extractValues(Object data); String toJson(Object data);  }