protected ProcessorResult doProcessElement(Arguments arguments, Element element,
HttpServletRequest request, HttpServletResponse response, HtmlTable htmlTable) {
if (htmlTable != null) {
HtmlColumn column = null;
String content = null;
if(element.hasAttribute(DataTablesDialect.DIALECT_PREFIX + ":csv")
|| element.hasAttribute(DataTablesDialect.DIALECT_PREFIX + ":xml")
|| element.hasAttribute(DataTablesDialect.DIALECT_PREFIX + ":pdf")
|| element.hasAttribute(DataTablesDialect.DIALECT_PREFIX + ":xls")
|| element.hasAttribute(DataTablesDialect.DIALECT_PREFIX + ":xlsx")){
if(element.hasAttribute(DataTablesDialect.DIALECT_PREFIX + ":csv")) {
content = AttributeUtils.parseAttribute(arguments, element, DataTablesDialect.DIALECT_PREFIX + ":csv", String.class);
element.removeAttribute(DataTablesDialect.DIALECT_PREFIX + ":csv");
column = new HtmlColumn(ReservedFormat.CSV);
column.setContent(new StringBuilder(content));
htmlTable.getLastBodyRow().addColumn(column);
}
if(element.hasAttribute(DataTablesDialect.DIALECT_PREFIX + ":xml")) {
content = AttributeUtils.parseAttribute(arguments, element, DataTablesDialect.DIALECT_PREFIX + ":xml", String.class);
element.removeAttribute(DataTablesDialect.DIALECT_PREFIX + ":xml");
column = new HtmlColumn(ReservedFormat.XML);
column.setContent(new StringBuilder(content));
htmlTable.getLastBodyRow().addColumn(column);
}
if(element.hasAttribute(DataTablesDialect.DIALECT_PREFIX + ":pdf")) {
content = AttributeUtils.parseAttribute(arguments, element, DataTablesDialect.DIALECT_PREFIX + ":pdf", String.class);
element.removeAttribute(DataTablesDialect.DIALECT_PREFIX + ":pdf");
column = new HtmlColumn(ReservedFormat.PDF);
column.setContent(new StringBuilder(content));
htmlTable.getLastBodyRow().addColumn(column);
}
if(element.hasAttribute(DataTablesDialect.DIALECT_PREFIX + ":xls")) {
content = AttributeUtils.parseAttribute(arguments, element, DataTablesDialect.DIALECT_PREFIX + ":xls", String.class);
element.removeAttribute(DataTablesDialect.DIALECT_PREFIX + ":xls");
column = new HtmlColumn(ReservedFormat.XLS);
column.setContent(new StringBuilder(content));
htmlTable.getLastBodyRow().addColumn(column);
}
if(element.hasAttribute(DataTablesDialect.DIALECT_PREFIX + ":xlsx")) {
content = AttributeUtils.parseAttribute(arguments, element, DataTablesDialect.DIALECT_PREFIX + ":xlsx", String.class);
element.removeAttribute(DataTablesDialect.DIALECT_PREFIX + ":xlsx");
column = new HtmlColumn(ReservedFormat.XLSX);
column.setContent(new StringBuilder(content));
htmlTable.getLastBodyRow().addColumn(column);
}
}
// If the element contains a Text node, the content of the text node
// will be displayed in all formats