org.thymeleaf.util
Class DOMUtils

Object
  extended by org.thymeleaf.util.DOMUtils

public final class DOMUtils
extends Object

Since:
1.1.2
Author:
Daniel Fernández

Method Summary
static char[] escapeXml(char[] ch, boolean escapeQuotes)
           
static String escapeXml(String str, boolean escapeQuotes)
           
static NestableNode extractFragmentByAttributeValue(Node root, String elementName, String attributeName, String attributeValue)
          Deprecated. Use extractFragmentByElementAndAttributeValue(List, String, String, String) instead. Will be removed in 2.1.x
static List<Node> extractFragmentByElementAndAttributeValue(List<Node> rootNodes, String elementName, String attributeName, String attributeValue)
           
static Document getDOMFor(Configuration configuration, Reader source, ITemplateParser parser)
           
static Document getDOMFor(Reader source, ITemplateParser parser)
           
static Document getHtml5DOMFor(Reader source)
           
static String getHtml5For(Node node)
           
static Document getLegacyHTML5DOMFor(Reader source)
           
static String getOutputFor(Arguments arguments, Node node, AbstractGeneralTemplateWriter templateWriter)
           
static String getOutputFor(Node node, AbstractGeneralTemplateWriter templateWriter, String templateMode)
           This method is for testing purposes only!
static Document getXhtmlDOMFor(Reader source)
           
static String getXhtmlFor(Node node)
           
static String getXhtmlHtml5For(Node node)
          Deprecated. To be removed in 2.1.0. Use getHtml5For(Node), getXhtmlFor(Node) or getOutputFor(Node, AbstractGeneralTemplateWriter, String) instead.
static Document getXmlDOMFor(Reader source)
           
static String getXmlFor(Node node)
           
static String unescapeXml(String str, boolean unescapeQuotes)
           
static void writeXmlEscaped(char[] buffer, Writer writer, boolean escapeQuotes)
           
static void writeXmlEscaped(String buffer, Writer writer, boolean escapeQuotes)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

extractFragmentByElementAndAttributeValue

public static List<Node> extractFragmentByElementAndAttributeValue(List<Node> rootNodes,
                                                                   String elementName,
                                                                   String attributeName,
                                                                   String attributeValue)

extractFragmentByAttributeValue

@Deprecated
public static NestableNode extractFragmentByAttributeValue(Node root,
                                                                      String elementName,
                                                                      String attributeName,
                                                                      String attributeValue)
Deprecated. Use extractFragmentByElementAndAttributeValue(List, String, String, String) instead. Will be removed in 2.1.x


escapeXml

public static char[] escapeXml(char[] ch,
                               boolean escapeQuotes)
                        throws IOException
Throws:
IOException

escapeXml

public static String escapeXml(String str,
                               boolean escapeQuotes)
                        throws IOException
Throws:
IOException

writeXmlEscaped

public static void writeXmlEscaped(String buffer,
                                   Writer writer,
                                   boolean escapeQuotes)
                            throws IOException
Throws:
IOException

writeXmlEscaped

public static void writeXmlEscaped(char[] buffer,
                                   Writer writer,
                                   boolean escapeQuotes)
                            throws IOException
Throws:
IOException

unescapeXml

public static String unescapeXml(String str,
                                 boolean unescapeQuotes)

getXmlFor

public static String getXmlFor(Node node)

getXhtmlHtml5For

@Deprecated
public static String getXhtmlHtml5For(Node node)
Deprecated. To be removed in 2.1.0. Use getHtml5For(Node), getXhtmlFor(Node) or getOutputFor(Node, AbstractGeneralTemplateWriter, String) instead.


getXhtmlFor

public static String getXhtmlFor(Node node)

getHtml5For

public static String getHtml5For(Node node)

getOutputFor

public static String getOutputFor(Node node,
                                  AbstractGeneralTemplateWriter templateWriter,
                                  String templateMode)

This method is for testing purposes only! It creates mock configuration, template and resource resolution artifacts, etc. Its usage during normal operation could heavily affect performance.

Parameters:
node - the node which output is to be computed
templateWriter - the template writter to be used for creating the output
Returns:
the computed output
Since:
2.0.8

getOutputFor

public static String getOutputFor(Arguments arguments,
                                  Node node,
                                  AbstractGeneralTemplateWriter templateWriter)
Since:
2.0.8

getHtml5DOMFor

public static Document getHtml5DOMFor(Reader source)
Since:
2.0.8

getLegacyHTML5DOMFor

public static Document getLegacyHTML5DOMFor(Reader source)
Since:
2.0.8

getXmlDOMFor

public static Document getXmlDOMFor(Reader source)
Since:
2.0.8

getXhtmlDOMFor

public static Document getXhtmlDOMFor(Reader source)
Since:
2.0.8

getDOMFor

public static Document getDOMFor(Reader source,
                                 ITemplateParser parser)
Since:
2.0.8

getDOMFor

public static Document getDOMFor(Configuration configuration,
                                 Reader source,
                                 ITemplateParser parser)
Since:
2.0.8


Copyright © 2013 The THYMELEAF team. All Rights Reserved.