}
}
private void executeTable(final CommandCall commandCall, final Evaluator evaluator,
final ResultRecorder resultRecorder) {
final TableSupport tableSupport = new TableSupport(commandCall);
// this is the bit that's different: also execute on the header
tableRow.set(TableRow.HEADER);
final Row headerRow = tableSupport.getLastHeaderRow();
commandCall.setElement(headerRow.getElement());
commandCall.execute(evaluator, resultRecorder);
// the rest is copied from Concordion's original implementation
tableRow.set(TableRow.BODY);
final Row[] detailRows = tableSupport.getDetailRows();
for (final Row detailRow : detailRows) {
if (detailRow.getCells().length != tableSupport.getColumnCount()) {
throw new RuntimeException(
"The <table> 'execute' command only supports rows with an equal number of columns.");
}
commandCall.setElement(detailRow.getElement());
tableSupport.copyCommandCallsTo(detailRow);
commandCall.execute(evaluator, resultRecorder);
}
tableRow.set(null);
}