// group's special summaries handled here
if (context == null)
context = field.specialFieldContext;
Object object = node.getImpl();
NodeWalker walkingVisitor = (NodeWalker) field.getSummaryVisitor((object instanceof GroupNodeImpl) ? field.getSummaryForGroup() : field
.getSummary(),object instanceof Document);
walkingVisitor.setNode(node);
walkingVisitor.setNodeModel(nodeModel);
walkingVisitor.setContext(context);
walkingVisitor.setField(field);
Object result = walkingVisitor.getSummary();
if (result instanceof Double) { // convert to proper display type
result = ClassUtils.doubleToObject((Double) result, field.getDisplayType());
}
if ((object instanceof GroupNodeImpl) && field.hasOptions()) { // TODO
// should