@Override protected ProcessorResult doProcessElement(Arguments arguments, Element element, HttpServletRequest request, HttpServletResponse response, HtmlTable htmlTable) { Map<Option<?>, Object> stagingConf = new HashMap<Option<?>, Object>(); Map<Option<?>, Extension> stagingExtension = new HashMap<Option<?>, Extension>(); // The staging configuration is stored as a local variable. It must be // accessible in all column head processors. Map<String, Object> newVariable = new HashMap<String, Object>(); newVariable.put(DataTablesDialect.INTERNAL_BEAN_COLUMN_STAGING_OPTIONS, stagingConf); newVariable.put(DataTablesDialect.INTERNAL_BEAN_COLUMN_STAGING_EXTENSIONS, stagingExtension); return ProcessorResult.setLocalVariables(newVariable); } }
@Override public final ProcessorResult processAttribute(final Arguments arguments, final Element element, final String attributeName) { final Map<String,Object> newLocalVariables = getNewLocalVariables(arguments, element, attributeName); if (newLocalVariables == null) { throw new TemplateProcessingException("Null variables map for \"" + attributeName + "\" attribute not allowed"); } element.removeAttribute(attributeName); return ProcessorResult.setLocalVariables(newLocalVariables); }
@Override protected ProcessorResult processElement(Arguments arguments, Element element) { logger.debug("{} element found", element.getNormalizedName()); // Get HtmlTable POJO from the HttpServletRequest HtmlTable htmlTable = Utils.getTable(arguments); // Get the TH content String content = element.getFirstChild() != null ? ((Text) element.getFirstChild()).getContent().trim() : ""; // Init a new column HtmlColumn htmlColumn = new HtmlColumn(true, content); // Add it to the table if(htmlTable != null){ htmlTable.getLastHeaderRow().addHeaderColumn(htmlColumn); } // HtmlColumn POJO is made available during the TH element processing Map<String, Object> newVariable = new HashMap<String, Object>(); newVariable.put("htmlColumn", htmlColumn); return ProcessorResult.setLocalVariables(newVariable); } }
@Override public final ProcessorResult processElement(final Arguments arguments, final Element element) { final boolean removeHostElement = removeHostElement(arguments, element); final Map<String,Object> newLocalVariables = getNewLocalVariables(arguments, element); if (newLocalVariables == null) { throw new TemplateProcessingException("Null variables map for \"" + element.getOriginalName() + "\" element not allowed"); } if (removeHostElement) { element.getParent().extractChild(element); } return ProcessorResult.setLocalVariables(newLocalVariables); }
return ProcessorResult.setLocalVariables(newVariable);
return ProcessorResult.setLocalVariables(pagefragments);