Ejemplo n.º 1
0
 public void handleBlankCell(Parse cell, TypeAdapter a) {
   try {
     cell.addToBody(gray(a.toString(a.get())));
   } catch (Exception e) {
     cell.addToBody(gray("error"));
   }
 }
Ejemplo n.º 2
0
    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);
      }
    }
Ejemplo n.º 3
0
 protected Map<Object, Object> cSort(List<?> list, int col) {
   TypeAdapter a = columnBindings[col].adapter;
   Map<Object, Object> result = new ConcurrentHashMap<Object, Object>(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;
 }
Ejemplo n.º 4
0
 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", "&nbsp;", 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;
 }