@Test public void should_generate_table_by_extracting_property_from_the_collection() { HtmlTable table = new HtmlTableBuilder<Person>().newBuilder("tableId", persons, request, null) .column().fillWithProperty("id").title("Id") .column().fillWithProperty("firstName").and("suffix").title("Firtname") .column().fillWith("prefix").andProperty("lastName").title("Lastname") .column().fillWithProperty("mail", "formatted-{0}").title("Mail") .build(); assertThat(table.getBodyRows()).hasSize(10); assertThat(table.getBodyRows().get(0).getColumns()).hasSize(4); assertThat(table.getBodyRows().get(0).getColumns().get(0).getContent().toString()).isEqualTo("1"); assertThat(table.getBodyRows().get(0).getColumns().get(1).getContent().toString()).isEqualTo("firstName1suffix"); assertThat(table.getBodyRows().get(0).getColumns().get(2).getContent().toString()).isEqualTo("prefixlastName1"); assertThat(table.getBodyRows().get(0).getColumns().get(3).getContent().toString()).isEqualTo("formatted-mail1"); assertThat(table.getBodyRows().get(9).getColumns().get(0).getContent().toString()).isEqualTo("10"); assertThat(table.getBodyRows().get(9).getColumns().get(1).getContent().toString()).isEqualTo("firstName10suffix"); assertThat(table.getBodyRows().get(9).getColumns().get(2).getContent().toString()).isEqualTo("prefixlastName10"); assertThat(table.getBodyRows().get(9).getColumns().get(3).getContent().toString()).isEqualTo("formatted-mail10"); }
public ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request) { return new Steps<T>(id, data, request); }
HtmlTableBuilder { public ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request) { return new Steps<T>(id, data, request); } }
HtmlTableBuilder { public ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request) { return new Steps<T>(id, data, request); }  }
HtmlTableBuilder { public ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request) { return new Steps<T>(id, data, request); }  ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request); ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request, ExportConf exportConf); }
HtmlTableBuilder { public ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request) { return new Steps<T>(id, data, request); }  ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request); ColumnStep newBuilder(String id, List<T> data, HttpServletRequest request, ExportConf exportConf);  }