Esempio n. 1
0
  @Override
  protected HtmlElement buildBodyContent(Object o) {
    HtmlTable table = HtmlElement.table();
    try {
      Map<String, Object> values = Binder.getFieldsValues(o);
      for (Map.Entry<String, Object> entry : values.entrySet()) {
        String k = entry.getKey();
        Object v = entry.getValue();

        HtmlTr tr = table.tr();

        HtmlElement fieldName = tr.td(k);
        HtmlElement fieldValue = tr.td(v.toString());
      }
    } catch (IllegalArgumentException | IllegalAccessException ex) {
      throw new RuntimeException(ex);
    }
    return table;
  }
Esempio n. 2
0
 @Override
 protected HtmlElement buildHeadContent(Object o) {
   HtmlElement title = title();
   title.add(new TextNode(o.getClass().toString()));
   return title;
 }