org.jsoup.nodes
Class DataNode

java.lang.Object
  extended by org.jsoup.nodes.Node
      extended by org.jsoup.nodes.DataNode
All Implemented Interfaces:
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, [email protected]

Constructor Summary
DataNode(String data, String baseUri)
          Create a new DataNode.
 
Method Summary
static DataNode createFromEncoded(String encodedData, String baseUri)
          Create a new DataNode from HTML encoded data.
 String getWholeData()
          Get the data contents of this node.
 String nodeName()
          Get the node name of this node.
 DataNode setWholeData(String data)
          Set the data contents of this node.
 String toString()
           
 
Methods inherited from class org.jsoup.nodes.Node
absUrl, addChildren, addChildren, after, after, attr, attr, attributes, baseUri, before, before, childNode, childNodes, childNodesAsArray, clone, doClone, equals, hasAttr, hashCode, indent, nextSibling, outerHtml, outerHtml, ownerDocument, parent, previousSibling, remove, removeAttr, removeChild, replaceChild, replaceWith, setBaseUri, setParentNode, setSiblingIndex, siblingIndex, siblingNodes, traverse, unwrap, wrap
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataNode

public DataNode(String data,
                String baseUri)
Create a new DataNode.

Parameters:
data - data contents
baseUri - base URI
Method Detail

nodeName

public 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).

Specified by:
nodeName in class Node
Returns:
node name

getWholeData

public 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(String data)
Set the data contents of this node.

Parameters:
data - unencoded data
Returns:
this node, for chaining

toString

public String toString()
Overrides:
toString in class Node

createFromEncoded

public static DataNode createFromEncoded(String encodedData,
                                         String baseUri)
Create a new DataNode from HTML encoded data.

Parameters:
encodedData - encoded data
baseUri - bass URI
Returns:
new DataNode


Copyright © 2009-2012 Jonathan Hedley. All Rights Reserved.