public final class DOMUtils extends Object
Modifier and Type | Method and Description |
---|---|
static char[] |
escapeXml(char[] ch,
boolean escapeQuotes)
Deprecated.
This method has been deprecated in 2.1.3 and is no longer an adequate way to obtain escaped
HTML code. The whole of the escaping mechanism defined on top of these DOMUtils escape/unescape
methods had too many drawbacks and issues, so it was completely replaced by the Unbescape library.
Will be removed in 3.0.
|
static String |
escapeXml(String str,
boolean escapeQuotes)
Deprecated.
This method has been deprecated in 2.1.3 and is no longer an adequate way to obtain escaped
HTML code. The whole of the escaping mechanism defined on top of these DOMUtils escape/unescape
methods had too many drawbacks and issues, so it was completely replaced by the Unbescape library.
Will be removed in 3.0.
|
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! It creates mock configuration, template and resource
resolution artifacts, etc.
|
static Document |
getXhtmlDOMFor(Reader source) |
static String |
getXhtmlFor(Node node) |
static Document |
getXmlDOMFor(Reader source) |
static String |
getXmlFor(Node node) |
static String |
unescapeXml(String str,
boolean unescapeQuotes)
Deprecated.
This method has been deprecated in 2.1.3 and is no longer an adequate way to obtain unescaped
HTML code. The whole of the escaping mechanism defined on top of these DOMUtils escape/unescape
methods had too many drawbacks and issues, so it was completely replaced by the Unbescape library.
Will be removed in 3.0.
|
static void |
writeXmlEscaped(char[] buffer,
Writer writer,
boolean escapeQuotes)
Deprecated.
This method has been deprecated in 2.1.3 and is no longer an adequate way to obtain escaped
HTML code. The whole of the escaping mechanism defined on top of these DOMUtils escape/unescape
methods had too many drawbacks and issues, so it was completely replaced by the Unbescape library.
Will be removed in 3.0.
|
static void |
writeXmlEscaped(String buffer,
Writer writer,
boolean escapeQuotes)
Deprecated.
This method has been deprecated in 2.1.3 and is no longer an adequate way to obtain escaped
HTML code. The whole of the escaping mechanism defined on top of these DOMUtils escape/unescape
methods had too many drawbacks and issues, so it was completely replaced by the Unbescape library.
Will be removed in 3.0.
|
public static List<Node> extractFragmentByElementAndAttributeValue(List<Node> rootNodes, String elementName, String attributeName, String attributeValue)
@Deprecated public static char[] escapeXml(char[] ch, boolean escapeQuotes) throws IOException
ch
- chescapeQuotes
- escapeQuotesIOException
- IOException@Deprecated public static String escapeXml(String str, boolean escapeQuotes) throws IOException
str
- strescapeQuotes
- escapeQuotesIOException
- IOException@Deprecated public static void writeXmlEscaped(String buffer, Writer writer, boolean escapeQuotes) throws IOException
buffer
- bufferwriter
- writerescapeQuotes
- escapeQuotesIOException
- IOException@Deprecated public static void writeXmlEscaped(char[] buffer, Writer writer, boolean escapeQuotes) throws IOException
buffer
- bufferwriter
- writerescapeQuotes
- escapeQuotesIOException
- IOException@Deprecated public static String unescapeXml(String str, boolean unescapeQuotes)
str
- strunescapeQuotes
- unescapeQuotespublic 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.
node
- the node which output is to be computedtemplateWriter
- the template writter to be used for creating the outputtemplateMode
- the template mode to be used for creating the outputpublic static String getOutputFor(Arguments arguments, Node node, AbstractGeneralTemplateWriter templateWriter)
arguments
- argumentsnode
- nodetemplateWriter
- templateWriterpublic static Document getHtml5DOMFor(Reader source)
source
- sourcepublic static Document getLegacyHTML5DOMFor(Reader source)
source
- sourcepublic static Document getXmlDOMFor(Reader source)
source
- sourcepublic static Document getXhtmlDOMFor(Reader source)
source
- sourcepublic static Document getDOMFor(Reader source, ITemplateParser parser)
source
- sourceparser
- parserpublic static Document getDOMFor(Configuration configuration, Reader source, ITemplateParser parser)
configuration
- configurationsource
- sourceparser
- parserCopyright © 2017 The THYMELEAF team. All rights reserved.