Top Description Inners Fields Constructors Methods
org.dom4j.dom

public Class DOMNodeHelper

extends Object
Class Inheritance
Imports
org.dom4j.*, org.w3c.dom.DOMException, .NamedNodeMap, .NodeList, java.util.List

DOMNodeHelper contains a collection of utility methods for use across Node implementations.

Author
James Strachan
Version
$Revision: 1.20 $

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final NodeList

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static Node
appendChild(Node node, Node newChild)

public static void
public static void
appendElementsByTagName(List<? super Element> list, Branch parent, String name)

public static void
appendElementsByTagNameNS(List<? super Element> list, Branch parent, String namespace, String localName)

public static Attr
asDOMAttr(Node attribute)

public static Document
public static DocumentType
public static Element
asDOMElement(Node element)

public static Node
public static Text
public static Node
cloneNode(Node node, boolean deep)

public static NodeList
createNodeList(final List<Node> list)

public static void
deleteData(CharacterData charData, int offset, int count)

public static NamedNodeMap
public static NodeList
public static String
public static Node
public static Node
public static int
public static String
public static String
public static Node
public static String
public static Document
public static Node
public static String
public static Node
public static boolean
public static boolean
public static Node
insertBefore(Node node, Node newChild, Node refChild)

public static void
insertData(CharacterData data, int offset, String arg)

public static boolean
isNodeEquals(Node node1, Node node2)

public static boolean
isNodeSame(Node node1, Node node2)

public static boolean
isStringEquals(String string1, String string2)

public static boolean
isSupported(Node n, String feature, String version)

public static void
public static void
notSupported()

Called when a method has not been implemented yet

public static Node
removeChild(Node node, Node oldChild)

public static Node
replaceChild(Node node, Node newChild, Node oldChild)

public static void
replaceData(CharacterData charData, int offset, int count, String arg)

public static void
setData(CharacterData charData, String data)

public static void
setNodeValue(Node node, String nodeValue)

public static void
setPrefix(Node node, String prefix)

public static String
substringData(CharacterData charData, int offset, int count)

public static boolean
supports(Node node, String feature, String version)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_NODE_LISTback to summary
public static final NodeList EMPTY_NODE_LIST

Constructor Detail

DOMNodeHelperback to summary
protected DOMNodeHelper()

Method Detail

appendChildback to summary
public static Node appendChild(Node node, Node newChild) throws DOMException
appendDataback to summary
public static void appendData(CharacterData charData, String arg) throws DOMException
appendElementsByTagNameback to summary
public static void appendElementsByTagName(List<? super Element> list, Branch parent, String name)
appendElementsByTagNameNSback to summary
public static void appendElementsByTagNameNS(List<? super Element> list, Branch parent, String namespace, String localName)
asDOMAttrback to summary
public static Attr asDOMAttr(Node attribute)
asDOMDocumentback to summary
public static Document asDOMDocument(Document document)
asDOMDocumentTypeback to summary
public static DocumentType asDOMDocumentType(DocumentType dt)
asDOMElementback to summary
public static Element asDOMElement(Node element)
asDOMNodeback to summary
public static Node asDOMNode(Node node)
asDOMTextback to summary
public static Text asDOMText(CharacterData text)
cloneNodeback to summary
public static Node cloneNode(Node node, boolean deep)
createNodeListback to summary
public static NodeList createNodeList(final List<Node> list)
deleteDataback to summary
public static void deleteData(CharacterData charData, int offset, int count) throws DOMException
getAttributesback to summary
public static NamedNodeMap getAttributes(Node node)
getChildNodesback to summary
public static NodeList getChildNodes(Node node)
getDataback to summary
public static String getData(CharacterData charData) throws DOMException
getFirstChildback to summary
public static Node getFirstChild(Node node)
getLastChildback to summary
public static Node getLastChild(Node node)
getLengthback to summary
public static int getLength(CharacterData charData)
getLocalNameback to summary
public static String getLocalName(Node node)
getNamespaceURIback to summary
public static String getNamespaceURI(Node node)
getNextSiblingback to summary
public static Node getNextSibling(Node node)
getNodeValueback to summary
public static String getNodeValue(Node node) throws DOMException
getOwnerDocumentback to summary
public static Document getOwnerDocument(Node node)
getParentNodeback to summary
public static Node getParentNode(Node node)
getPrefixback to summary
public static String getPrefix(Node node)
getPreviousSiblingback to summary
public static Node getPreviousSibling(Node node)
hasAttributesback to summary
public static boolean hasAttributes(Node node)
hasChildNodesback to summary
public static boolean hasChildNodes(Node node)
insertBeforeback to summary
public static Node insertBefore(Node node, Node newChild, Node refChild) throws DOMException
insertDataback to summary
public static void insertData(CharacterData data, int offset, String arg) throws DOMException
isNodeEqualsback to summary
public static boolean isNodeEquals(Node node1, Node node2)
isNodeSameback to summary
public static boolean isNodeSame(Node node1, Node node2)
isStringEqualsback to summary
public static boolean isStringEquals(String string1, String string2)
isSupportedback to summary
public static boolean isSupported(Node n, String feature, String version)
normalizeback to summary
public static void normalize(Node node)
notSupportedback to summary
public static void notSupported()

Called when a method has not been implemented yet

Exceptions
DOMException:
DOCUMENT ME!
removeChildback to summary
public static Node removeChild(Node node, Node oldChild) throws DOMException
replaceChildback to summary
public static Node replaceChild(Node node, Node newChild, Node oldChild) throws DOMException
replaceDataback to summary
public static void replaceData(CharacterData charData, int offset, int count, String arg) throws DOMException
setDataback to summary
public static void setData(CharacterData charData, String data) throws DOMException
setNodeValueback to summary
public static void setNodeValue(Node node, String nodeValue) throws DOMException
setPrefixback to summary
public static void setPrefix(Node node, String prefix) throws DOMException
substringDataback to summary
public static String substringData(CharacterData charData, int offset, int count) throws DOMException
supportsback to summary
public static boolean supports(Node node, String feature, String version)
org.dom4j.dom back to summary

public Class DOMNodeHelper.EmptyNodeList

extends Object
implements NodeList
Class Inheritance
All Implemented Interfaces
org.w3c.dom.NodeList

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
getLength()

Implements org.w3c.dom.NodeList.getLength.

The number of nodes in the list.
public Node
item(int
Index into the collection.
index
)

Implements org.w3c.dom.NodeList.item.

Returns the indexth item in the collection.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

EmptyNodeListback to summary
public EmptyNodeList()

Method Detail

getLengthback to summary
public int getLength()

Implements org.w3c.dom.NodeList.getLength.

Doc from org.w3c.dom.NodeList.getLength.

The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.

itemback to summary
public Node item(int index)

Implements org.w3c.dom.NodeList.item.

Doc from org.w3c.dom.NodeList.item.

Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.

Parameters
index:int

Index into the collection.

Returns:Node

The node at the indexth position in the NodeList, or null if that is not a valid index.