this.executableBeginTime = System.currentTimeMillis();
}
private void endExecutable() throws ReportWriterException {
if (result != null) {
final AbstractExecutable executable = result.getExecutable();
final String elementName;
if (executable instanceof Concept) {
elementName = "concept";
} else if (executable instanceof Constraint) {
elementName = "constraint";
} else {
throw new ReportWriterException("Cannot write report for unsupported executable " + executable);
}
final List<String> columnNames = result.getColumnNames();
run(new XmlOperation() {
@Override
public void run() throws XMLStreamException {
xmlStreamWriter.writeStartElement(elementName);
xmlStreamWriter.writeAttribute("id", executable.getId());
xmlStreamWriter.writeStartElement("description");
xmlStreamWriter.writeCharacters(executable.getDescription());
xmlStreamWriter.writeEndElement(); //description
if (!result.isEmpty()) {
xmlStreamWriter.writeStartElement("result");
xmlStreamWriter.writeStartElement("columns");
xmlStreamWriter.writeAttribute("count", Integer.toString(columnNames.size()));