Top Description Constructors Methods
org.dom4j.dom

public Class DOMCDATA

extends DefaultCDATA
implements CDATASection
Class Inheritance
All Implemented Interfaces
org.w3c.dom.CDATASection, org.w3c.dom.Text, org.w3c.dom.CharacterData, org.w3c.dom.Node
Imports
org.dom4j.CDATA, .Element, org.dom4j.tree.DefaultCDATA, org.w3c.dom.*

DOMCDATA implements a CDATA Section which supports the W3C DOM API.

Author
James Strachan
Version
$Revision: 1.12 $

Constructor Summary

AccessConstructor and Description
public
public
DOMCDATA(Element parent, String text)

Method Summary

Modifier and TypeMethod and Description
public Node
appendChild(Node
The node to add.If it is a DocumentFragment object, the entire contents of the document fragment are moved into the child list of this node
newChild
)

Implements org.w3c.dom.Node.appendChild.

Adds the node newChild to the end of the list of children of this node.
public void
appendData(String
The DOMString to append.
arg
)

Implements org.w3c.dom.CharacterData.appendData.

Append the string to the end of the character data of the node.
private void
public Node
cloneNode(boolean
If true, recursively clone the subtree under the specified node; if false, clone only the node itself (and its attributes, if it is an Element).
deep
)

Implements org.w3c.dom.Node.cloneNode.

Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
public short
compareDocumentPosition(Node
The node to compare against the reference node.
other
)

Implements org.w3c.dom.Node.compareDocumentPosition.

Compares the reference node, i.e. the node on which this method is being called, with a node, i.e. the one passed as a parameter, with regard to their position in the document and according to the document order.
protected CDATA
public void
deleteData(int
The offset from which to start removing.
offset
,
int
The number of 16-bit units to delete. If the sum of offset and count exceeds length then all 16-bit units from offset to the end of the data are deleted.
count
)

Implements org.w3c.dom.CharacterData.deleteData.

Remove a range of 16-bit units from the node.
public NamedNodeMap
getAttributes()

Implements org.w3c.dom.Node.getAttributes.

A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
public String
getBaseURI()

Implements org.w3c.dom.Node.getBaseURI.

The absolute base URI of this node or null if the implementation wasn't able to obtain an absolute URI.
public NodeList
getChildNodes()

Implements org.w3c.dom.Node.getChildNodes.

A NodeList that contains all children of this node.
public String
getData()

Implements org.w3c.dom.CharacterData.getData.

The character data of the node that implements this interface.
public Object
getFeature(String
The name of the feature requested. Note that any plus sign "+" prepended to the name of the feature will be ignored since it is not significant in the context of this method.
feature
,
String
This is the version number of the feature to test.
version
)

Implements org.w3c.dom.Node.getFeature.

This method returns a specialized object which implements the specialized APIs of the specified feature and version, as specified in .
public Node
getFirstChild()

Implements org.w3c.dom.Node.getFirstChild.

The first child of this node.
public Node
getLastChild()

Implements org.w3c.dom.Node.getLastChild.

The last child of this node.
public int
getLength()

Implements org.w3c.dom.CharacterData.getLength.

The number of 16-bit units that are available through data and the substringData method below.
public String
getLocalName()

Implements org.w3c.dom.Node.getLocalName.

Returns the local part of the qualified name of this node.
public String
getNamespaceURI()

Implements org.w3c.dom.Node.getNamespaceURI.

The namespace URI of this node, or null if it is unspecified (see ).
public Node
getNextSibling()

Implements org.w3c.dom.Node.getNextSibling.

The node immediately following this node.
public String
getNodeName()

Implements org.w3c.dom.Node.getNodeName.

The name of this node, depending on its type; see the table above.
public String
getNodeValue()

Implements org.w3c.dom.Node.getNodeValue.

The value of this node, depending on its type; see the table above.
public Document
getOwnerDocument()

Implements org.w3c.dom.Node.getOwnerDocument.

The Document object associated with this node.
public Node
getParentNode()

Implements org.w3c.dom.Node.getParentNode.

The parent of this node.
public String
getPrefix()

Implements org.w3c.dom.Node.getPrefix.

The namespace prefix of this node, or null if it is unspecified.
public Node
getPreviousSibling()

Implements org.w3c.dom.Node.getPreviousSibling.

The node immediately preceding this node.
public String
getTextContent()

Implements org.w3c.dom.Node.getTextContent.

This attribute returns the text content of this node and its descendants.
public Object
getUserData(String
The key the object is associated to.
key
)

Implements org.w3c.dom.Node.getUserData.

Retrieves the object associated to a key on a this node.
public String
getWholeText()

Implements org.w3c.dom.Text.getWholeText.

Returns all text of Text nodes logically-adjacent text nodes to this node, concatenated in document order.
public boolean
hasAttributes()

Implements org.w3c.dom.Node.hasAttributes.

Returns whether this node (if it is an element) has any attributes.
public boolean
hasChildNodes()

Implements org.w3c.dom.Node.hasChildNodes.

Returns whether this node has any children.
public Node
insertBefore(Node
The node to insert.
newChild
,
Node
The reference node, i.e., the node before which the new node must be inserted.
refChild
)

Implements org.w3c.dom.Node.insertBefore.

Inserts the node newChild before the existing child node refChild.
public void
insertData(int
The character offset at which to insert.
offset
,
String
The DOMString to insert.
arg
)

Implements org.w3c.dom.CharacterData.insertData.

Insert a string at the specified 16-bit unit offset.
public boolean
isDefaultNamespace(String
The namespace URI to look for.
namespaceURI
)

Implements org.w3c.dom.Node.isDefaultNamespace.

This method checks if the specified namespaceURI is the default namespace or not.
public boolean
isElementContentWhitespace()

Implements org.w3c.dom.Text.isElementContentWhitespace.

Returns whether this text node contains element content whitespace, often abusively called "ignorable whitespace".
public boolean
isEqualNode(Node
The node to compare equality with.
other
)

Implements org.w3c.dom.Node.isEqualNode.

Tests whether two nodes are equal.
public boolean
isSameNode(Node
The node to test against.
other
)

Implements org.w3c.dom.Node.isSameNode.

Returns whether this node is the same node as the given one.
public boolean
isSupported(String
The name of the feature to test.
feature
,
String
This is the version number of the feature to test.
version
)

Implements org.w3c.dom.Node.isSupported.

Tests whether the DOM implementation implements a specific feature and that feature is supported by this node, as specified in .
public String
lookupNamespaceURI(String
The prefix to look for. If this parameter is null, the method will return the default namespace URI if any.
prefix
)

Implements org.w3c.dom.Node.lookupNamespaceURI.

Look up the namespace URI associated to the given prefix, starting from this node.
public String
lookupPrefix(String
The namespace URI to look for.
namespaceURI
)

Implements org.w3c.dom.Node.lookupPrefix.

Look up the prefix associated to the given namespace URI, starting from this node.
public void
normalize()

Implements org.w3c.dom.Node.normalize.

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.
public Node
removeChild(Node
The node being removed.
oldChild
)

Implements org.w3c.dom.Node.removeChild.

Removes the child node indicated by oldChild from the list of children, and returns it.
public Node
replaceChild(Node
The new node to put in the child list.
newChild
,
Node
The node being replaced in the list.
oldChild
)

Implements org.w3c.dom.Node.replaceChild.

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
public void
replaceData(int
The offset from which to start replacing.
offset
,
int
The number of 16-bit units to replace. If the sum of offset and count exceeds length, then all 16-bit units to the end of the data are replaced; (i.e., the effect is the same as a remove method call with the same range, followed by an append method invocation).
count
,
String
The DOMString with which the range must be replaced.
arg
)

Implements org.w3c.dom.CharacterData.replaceData.

Replace the characters starting at the specified 16-bit unit offset with the specified string.
public Text
replaceWholeText(String
The content of the replacing Text node.
content
)

Implements org.w3c.dom.Text.replaceWholeText.

Replaces the text of the current node and all logically-adjacent text nodes with the specified text.
public void
setData(String data)

Implements org.w3c.dom.CharacterData.setData.

The character data of the node that implements this interface.
public void
setNodeValue(String nodeValue)

Implements org.w3c.dom.Node.setNodeValue.

The value of this node, depending on its type; see the table above.
public void
setPrefix(String prefix)

Implements org.w3c.dom.Node.setPrefix.

The namespace prefix of this node, or null if it is unspecified.
public void
setTextContent(String textContent)

Implements org.w3c.dom.Node.setTextContent.

This attribute returns the text content of this node and its descendants.
public Object
setUserData(String
The key to associate the object to.
key
,
Object
The object to associate to the given key, or null to remove any existing association to that key.
data
,
UserDataHandler
The handler to associate to that key, or null.
handler
)

Implements org.w3c.dom.Node.setUserData.

Associate an object to a key on this node.
public Text
splitText(int
The 16-bit unit offset at which to split, starting from 0.
offset
)

Implements org.w3c.dom.Text.splitText.

Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings.
public String
substringData(int
Start offset of substring to extract.
offset
,
int
The number of 16-bit units to extract.
count
)

Implements org.w3c.dom.CharacterData.substringData.

Extracts a range of data from the node.
public boolean
supports(String feature, String version)

Inherited from org.dom4j.tree.DefaultCDATA:
getParentisReadOnlysetParentsetTextsupportsParent