@Override @SuppressWarnings("unchecked") protected ProcessorResult processAttribute(Arguments arguments, Element element, String attributeName) { Map<Option<?>, Object> stagingOptions = (Map<Option<?>, Object>) arguments .getLocalVariable(DataTablesDialect.INTERNAL_BEAN_COLUMN_STAGING_OPTIONS); Map<Option<?>, Extension> stagingExtensions = (Map<Option<?>, Extension>) arguments .getLocalVariable(DataTablesDialect.INTERNAL_BEAN_COLUMN_STAGING_EXTENSIONS); // Perform the actual attribute processing doProcessAttribute(arguments, element, attributeName, stagingOptions, stagingExtensions); // Housekeeping element.removeAttribute(attributeName); return ProcessorResult.ok(); }
@Override public ProcessorResult processTextNode(final Arguments arguments, final AbstractTextNode textNode) { if (!textNode.getProcessTextNodes()) { throw new TemplateProcessingException("Cannot execute text inlining processor: Text processors are not active"); } final Object inliner = arguments.getLocalVariable(StandardDialect.INLINER_LOCAL_VARIABLE); if (inliner == null) { if (this.logger.isTraceEnabled()) { this.logger.trace("[THYMELEAF][{}][{}] Will not process Text node as inline: no inliner has been set. " + "Please note that setting the 'processOnlyElementNodes' flag to false at a high level in the DOM " + "tree (like for example using " + ProcessAllNodesDocumentProcessor.class.getName() + ") can reduce " + "processing performance in templates with a big amount of Text nodes. Consider setting this flag " + "back to true at some point in your DOM tree to reduce this effect.", new Object[] {TemplateEngine.threadIndex(), arguments.getTemplateName()}); } return ProcessorResult.OK; } if (!(inliner instanceof IStandardTextInliner)) { throw new TemplateProcessingException("Cannot execute text inlining processor: Inliner set does not implement " + IStandardTextInliner.class.getName() + " (it is an object of class " + inliner.getClass().getName() + ")"); } ((IStandardTextInliner)inliner).inline(arguments, textNode); return ProcessorResult.OK; }
/** * {@inheritDoc} */ @Override protected ProcessorResult processAttribute(Arguments arguments, Element element, String attributeName) { // Ensure this attribute is only on the <title> element if (!element.getNormalizedName().equals(HTML_ELEMENT_TITLE)) { logger.error("layout:title-pattern attribute should only appear in a <title> element"); throw new IllegalArgumentException("layout:title-pattern attribute should only appear in a <title> element"); } // Replace the <title> text with the expanded title pattern String titlepattern = element.getAttributeValue(attributeName); String decoratortitle = (String)arguments.getLocalVariable(DECORATOR_TITLE_NAME); String contenttitle = element.hasChildren() ? ((Text)element.getFirstChild()).getContent() : ""; element.clearChildren(); element.addChild(new Text(titlepattern .replace(PARAM_TITLE_DECORATOR, decoratortitle) .replace(PARAM_TITLE_CONTENT, contenttitle))); element.removeAttribute(attributeName); return ProcessorResult.OK; } }
Element pagefragment = (Element)arguments.getLocalVariable(FRAGMENT_NAME_PREFIX + fragmentname); element.removeAttribute(attributeName);
.getLocalVariable(DataTablesDialect.INTERNAL_BEAN_COLUMN_STAGING_OPTIONS); Map<Option<?>, Extension> stagingExtensions = (Map<Option<?>, Extension>) arguments .getLocalVariable(DataTablesDialect.INTERNAL_BEAN_COLUMN_STAGING_EXTENSIONS);
(SwitchStructure) arguments.getLocalVariable(AbstractStandardSwitchStructureAttrProcessor.SWITCH_VARIABLE_NAME);