Package org.thymeleaf.dom

Examples of org.thymeleaf.dom.Macro


            }
           
            // Remove previous element children
            element.clearChildren();

            final Macro errorsNode = new Macro(strBuilder.toString());
            errorsNode.setProcessable(false);

            element.addChild(errorsNode);

            element.removeAttribute(attributeName);
           
View Full Code Here


            }
           
            // Remove previous element children
            element.clearChildren();

            final Macro errorsNode = new Macro(strBuilder.toString());
            errorsNode.setProcessable(false);

            element.addChild(errorsNode);

            element.removeAttribute(attributeName);
           
View Full Code Here

    try {
      NestableNode parent = element.getParent();
      parent.removeChild(element);
      ((AbstractGeneralTemplateWriter) templateWriter).writeNode(arguments, writer, parent);

      Node content = new Macro(writer.toString());
      CacheManager.put(arguments, cacheName, Collections.singletonList(content));
    } catch (IOException e) {
      throw new TemplateOutputException("Error during creation of output", e);
    }
    return ProcessorResult.OK;
View Full Code Here

    protected final List<Node> getModifiedChildren(
            final Arguments arguments, final Element element, final String attributeName) {
       
        final String text = getText(arguments, element, attributeName);

        final Macro node = new Macro(text);
        // Setting this allows avoiding text inliners processing already generated text,
        // which in turn avoids code injection.
        node.setProcessable(false);

        return Collections.singletonList((Node) node);

    }
View Full Code Here

    try {
      NestableNode parent = element.getParent();
      parent.removeChild(element);
      ((AbstractGeneralTemplateWriter) templateWriter).writeNode(arguments, writer, parent);

      Node content = new Macro(writer.toString());
      CacheManager.INSTANCE.put(arguments, cacheName, Collections.singletonList(content));
    } catch (IOException e) {
      throw new TemplateOutputException("Error during creation of output", e);
    }
    return ProcessorResult.OK;
View Full Code Here

        sb.append(buildContentMap(arguments)).append(";\n  ");
        sb.append(getUncacheableDataFunction(arguments, element)).append(";\n");
        sb.append("</SCRIPT>");
               
        // Add contentNode to the document
        Node contentNode = new Macro(sb.toString());
        element.clearChildren();
        element.getParent().insertAfter(element, contentNode);
        element.getParent().removeChild(element);

        // Return OK
View Full Code Here

            }
           
            sb.append("</script>");
           
            // Add contentNode to the document
            Node contentNode = new Macro(sb.toString());
            element.clearChildren();
            element.getParent().insertAfter(element, contentNode);
            element.getParent().removeChild(element);
        } else {
            Log.warn("No trackers were found, not outputting Google Analytics script. Set the googleAnalytics.webPropertyId"
View Full Code Here

    }

    protected final Node getTextNode(final Arguments arguments, final Element element, final String attributeName) {
        final String text = getText(arguments, element, attributeName);

        final Macro node = new Macro(text);
        // Setting this allows avoiding text inliners processing already generated text,
        // which in turn avoids code injection.
        node.setProcessable(false);

        return node;
    }
View Full Code Here

        } catch (final RenderException | IOException e) {
            throw new TemplateProcessingException("render area element", e);
        }

        // now convert the cms:area into a macro node and return done
        final Macro macro = new Macro(out.toString());
        macro.setProcessable(false);

        // remove all children so they are ignored
        element.clearChildren();
        // and set children now to be our html
        element.setChildren(Collections.<Node> singletonList(macro));
View Full Code Here

TOP

Related Classes of org.thymeleaf.dom.Macro

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.