public String toString(Object o) { if (o == null) return ""; int length = Array.getLength(o); StringBuffer b = new StringBuffer(5 * length); for (int i = 0; i < length; i++) { b.append(componentAdapter.toString(Array.get(o, i))); if (i < (length - 1)) { b.append(", "); } } return b.toString(); }
@Override public String toString(Object o) { if (o == null) return ""; int length = Array.getLength(o); StringBuilder b = new StringBuilder(5 * length); for (int i = 0; i < length; i++) { b.append(componentAdapter.toString(Array.get(o, i))); if (i < (length - 1)) { b.append(", "); } } return b.toString(); }
@Override public String toString(Object o) { if (o == null) return ""; int length = Array.getLength(o); StringBuilder b = new StringBuilder(5 * length); for (int i = 0; i < length; i++) { b.append(componentAdapter.toString(Array.get(o, i))); if (i < (length - 1)) { b.append(", "); } } return b.toString(); }
private void compare() { if (typeAdapter.equals(expected, result)) { right(cell); } else { wrong(cell, typeAdapter.toString(result)); } }
private void compare() { if (typeAdapter.equals(expected, result)) { right(cell); } else { wrong(cell, typeAdapter.toString(result)); } }
private void handleErrorInCell(TypeAdapter a, Parse cell) { try { Object result = a.invoke(); wrong(cell, a.toString(result)); } catch (IllegalAccessException e) { exception(cell, e); } catch (Exception e) { right(cell); } }
private void handleErrorInCell(TypeAdapter a, Parse cell) { try { Object result = a.invoke(); wrong(cell, a.toString(result)); } catch (IllegalAccessException e) { exception(cell, e); } catch (Exception e) { right(cell); } }
public void handleBlankCell(Parse cell, TypeAdapter a) { try { cell.addToBody(gray(a.toString(a.get()))); } catch (Exception e) { cell.addToBody(gray("error")); } }
public void handleBlankCell(Parse cell, TypeAdapter a) { try { cell.addToBody(gray(a.toString(a.get()))); } catch (Exception e) { cell.addToBody(gray("error")); } }
protected Parse buildCells(Object row) { if (row == null) { Parse nil = new Parse("td", "null", null, null); nil.addToTag(" colspan="+columnBindings.length); return nil; } Parse root = new Parse(null, null, null, null); Parse next = root; for (int i=0; i<columnBindings.length; i++) { next = next.more = new Parse("td", " ", null, null); TypeAdapter a = columnBindings[i]; if (a == null) { ignore (next); } else { try { a.target = row; info(next, a.toString(a.get())); } catch (Exception e) { exception(next, e); } } } return root.more; } }
protected Parse buildCells(Object row) { if (row == null) { Parse nil = new Parse("td", "null", null, null); nil.addToTag(" colspan=" + columnBindings.length); return nil; } Parse root = new Parse(null, null, null, null); Parse next = root; for (Binding columnBinding : columnBindings) { next = next.more = new Parse("td", " ", null, null); TypeAdapter a = columnBinding.adapter; if (a == null) { ignore(next); } else { try { a.target = row; next.body = gray(escape(a.toString(a.get()))); } catch (Exception e) { exception(next, e); } } } return root.more; } }
protected Parse buildCells(Object row) { if (row == null) { Parse nil = new Parse("td", "null", null, null); nil.addToTag(" colspan=" + columnBindings.length); return nil; } Parse root = new Parse(null, null, null, null); Parse next = root; for (Binding columnBinding : columnBindings) { next = next.more = new Parse("td", " ", null, null); TypeAdapter a = columnBinding.adapter; if (a == null) { ignore(next); } else { try { a.target = row; next.body = gray(escape(a.toString(a.get()))); } catch (Exception e) { exception(next, e); } } } return root.more; } }