/** * @return value to store. * @throws Exception * if value could not be retrieved */ protected Object getValue() throws Exception { return adapter.get(); // ...might be validly null } }
protected Map cSort(List list, int col) { TypeAdapter a = columnBindings[col]; Map result = new HashMap(list.size()); for (Iterator<?> i=list.iterator(); i.hasNext(); ) { Object row = i.next(); try { a.target = row; Object key = a.get(); bin(result, key, row); } catch (Exception e) { // surplus anything with bad keys, including null surplus.add(row); } } return result; }
protected Map<Object, Object> cSort(List<?> list, int col) { TypeAdapter a = columnBindings[col].adapter; Map<Object, Object> result = new HashMap<>(list.size()); for (Object row : list) { try { a.target = row; Object key = a.get(); bin(result, key, row); } catch (Exception e) { // surplus anything with bad keys, including null surplus.add(row); } } return result; }
protected Map<Object, Object> cSort(List<?> list, int col) { TypeAdapter a = columnBindings[col].adapter; Map<Object, Object> result = new ConcurrentHashMap<>(list.size()); for (Object row : list) { try { a.target = row; Object key = a.get(); bin(result, key, row); } catch (Exception e) { // surplus anything with bad keys, including null surplus.add(row); } } return result; }
private void compareCellToResult(TypeAdapter a, Parse theCell) { typeAdapter = a; cell = theCell; try { result = typeAdapter.get(); expected = parseCell(); if (expected instanceof Unparseable) tryRelationalMatch(); else compare(); } catch (Exception e) { exception(cell, e); } }
public void handleBlankCell(Parse cell, TypeAdapter a) { try { cell.addToBody(gray(a.toString(a.get()))); } catch (Exception e) { cell.addToBody(gray("error")); } }
private void compareCellToResult(TypeAdapter a, Parse theCell) { typeAdapter = a; cell = theCell; try { result = typeAdapter.get(); expected = parseCell(); if (expected instanceof Unparseable) tryRelationalMatch(); else compare(); } catch (Exception e) { exception(cell, e); } }
public void handleBlankCell(Parse cell, TypeAdapter a) { try { cell.addToBody(gray(a.toString(a.get()))); } catch (Exception e) { cell.addToBody(gray("error")); } }
@Override public void doCell(Fixture fixture, Parse cell) { try { //TODO-MdM hmm... somehow this needs to regulated by the fixture. if (fixture instanceof ColumnFixture) ((ColumnFixture) fixture).executeIfNeeded(); Object valueObj = adapter.get(); //...might be validly null String symbolValue = valueObj == null ? "null" : valueObj.toString(); String symbolName = cell.text(); Fixture.setSymbol(symbolName, symbolValue); cell.addToBody(Fixture.gray(" = " + symbolValue)); } catch (Exception e) { fixture.exception(cell, e); } } }
@Override public void doCell(Fixture fixture, Parse cell) { try { //TODO-MdM hmm... somehow this needs to regulated by the fixture. if (fixture instanceof ColumnFixture) ((ColumnFixture) fixture).executeIfNeeded(); Object valueObj = adapter.get(); //...might be validly null String symbolValue = valueObj == null ? "null" : valueObj.toString(); String symbolName = cell.text(); Fixture.setSymbol(symbolName, symbolValue); cell.addToBody(Fixture.gray(" = " + symbolValue)); } catch (Exception e) { fixture.exception(cell, e); } } }
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; } }