diff options
author | Artur Signell <artur@vaadin.com> | 2012-08-28 20:00:00 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-09-09 11:22:54 +0300 |
commit | 38212596d91e9e167253d7debb154d18e3ff38b0 (patch) | |
tree | 99775812644e3ef421cfa3a6039677bc4cdb8093 /server/src/org/jsoup/nodes/DataNode.java | |
parent | 0a77dae8b57a99cb5112a387b2a374c14e1fae1b (diff) | |
download | vaadin-framework-38212596d91e9e167253d7debb154d18e3ff38b0.tar.gz vaadin-framework-38212596d91e9e167253d7debb154d18e3ff38b0.zip |
Jsoup is now declared as a dependency (#9299)
Diffstat (limited to 'server/src/org/jsoup/nodes/DataNode.java')
-rw-r--r-- | server/src/org/jsoup/nodes/DataNode.java | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/server/src/org/jsoup/nodes/DataNode.java b/server/src/org/jsoup/nodes/DataNode.java deleted file mode 100644 index cc377a4cc8..0000000000 --- a/server/src/org/jsoup/nodes/DataNode.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.jsoup.nodes; - -/** - * A data node, for contents of style, script tags etc, where contents should - * not show in text(). - * - * @author Jonathan Hedley, jonathan@hedley.net - */ -public class DataNode extends Node { - private static final String DATA_KEY = "data"; - - /** - * Create a new DataNode. - * - * @param data - * data contents - * @param baseUri - * base URI - */ - public DataNode(String data, String baseUri) { - super(baseUri); - attributes.put(DATA_KEY, data); - } - - @Override - public String nodeName() { - return "#data"; - } - - /** - * Get the data contents of this node. Will be unescaped and with original - * new lines, space etc. - * - * @return data - */ - public String getWholeData() { - return attributes.get(DATA_KEY); - } - - /** - * Set the data contents of this node. - * - * @param data - * unencoded data - * @return this node, for chaining - */ - public DataNode setWholeData(String data) { - attributes.put(DATA_KEY, data); - return this; - } - - @Override - void outerHtmlHead(StringBuilder accum, int depth, - Document.OutputSettings out) { - accum.append(getWholeData()); // data is not escaped in return from data - // nodes, so " in script, style is plain - } - - @Override - void outerHtmlTail(StringBuilder accum, int depth, - Document.OutputSettings out) { - } - - @Override - public String toString() { - return outerHtml(); - } - - /** - * Create a new DataNode from HTML encoded data. - * - * @param encodedData - * encoded data - * @param baseUri - * bass URI - * @return new DataNode - */ - public static DataNode createFromEncoded(String encodedData, String baseUri) { - String data = Entities.unescape(encodedData); - return new DataNode(data, baseUri); - } -} |