Package org.jsoup.nodes
Class DataNode
- java.lang.Object
-
- org.jsoup.nodes.Node
-
- org.jsoup.nodes.DataNode
-
- All Implemented Interfaces:
java.lang.Cloneable
public class DataNode extends Node
A data node, for contents of style, script tags etc, where contents should not show in text().- Author:
- Jonathan Hedley, jonathan@hedley.net
-
-
Constructor Summary
Constructors Constructor Description DataNode(java.lang.String data, java.lang.String baseUri)
Create a new DataNode.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataNode
createFromEncoded(java.lang.String encodedData, java.lang.String baseUri)
Create a new DataNode from HTML encoded data.java.lang.String
getWholeData()
Get the data contents of this node.java.lang.String
nodeName()
Get the node name of this node.DataNode
setWholeData(java.lang.String data)
Set the data contents of this node.java.lang.String
toString()
-
Methods inherited from class org.jsoup.nodes.Node
absUrl, addChildren, addChildren, after, after, attr, attr, attributes, baseUri, before, before, childNode, childNodes, childNodesAsArray, childNodesCopy, childNodeSize, clone, doClone, ensureChildNodes, equals, hasAttr, hasSameValue, html, indent, nextSibling, outerHtml, outerHtml, ownerDocument, parent, parentNode, previousSibling, remove, removeAttr, removeChild, reparentChild, replaceChild, replaceWith, root, setBaseUri, setParentNode, setSiblingIndex, siblingIndex, siblingNodes, traverse, unwrap, wrap
-
-
-
-
Method Detail
-
nodeName
public java.lang.String nodeName()
Description copied from class:Node
Get the node name of this node. Use for debugging purposes and not logic switching (for that, use instanceof).
-
getWholeData
public java.lang.String getWholeData()
Get the data contents of this node. Will be unescaped and with original new lines, space etc.- Returns:
- data
-
setWholeData
public DataNode setWholeData(java.lang.String data)
Set the data contents of this node.- Parameters:
data
- unencoded data- Returns:
- this node, for chaining
-
createFromEncoded
public static DataNode createFromEncoded(java.lang.String encodedData, java.lang.String baseUri)
Create a new DataNode from HTML encoded data.- Parameters:
encodedData
- encoded databaseUri
- bass URI- Returns:
- new DataNode
-
-