@Override
public String getAsText() {
// Use HtmlTag, same as we do for fitnesse.wikitext.parser.HashTable.
Map<Object, Object> hash = (Map) getValue();
HtmlTag table = new HtmlTag("table");
table.addAttribute("class", "hash_table");
for (Map.Entry<Object, Object> entry : hash.entrySet()) {
HtmlTag row = new HtmlTag("tr");
row.addAttribute("class", "hash_row");
table.add(row);
String key = entry.getKey().toString();
HtmlTag keyCell = new HtmlTag("td", key.trim());
keyCell.addAttribute("class", "hash_key");
row.add(keyCell);
String value = entry.getValue().toString();
HtmlTag valueCell = new HtmlTag("td", value.trim());
valueCell.addAttribute("class", "hash_value");
row.add(valueCell);
}
return table.html().trim();
}