org.dom4j.dom
Class DOMNodeHelper

java.lang.Object
  extended byorg.dom4j.dom.DOMNodeHelper

public class DOMNodeHelper
extends Object

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

Version:
$Revision: 1.20 $
Author:
James Strachan

Nested Class Summary
static class DOMNodeHelper.EmptyNodeList
           
 
Field Summary
static NodeList EMPTY_NODE_LIST
           
 
Constructor Summary
protected DOMNodeHelper()
           
 
Method Summary
static Node appendChild(Node node, Node newChild)
           
static void appendData(CharacterData charData, String arg)
           
static void appendElementsByTagName(List list, Branch parent, String name)
           
static void appendElementsByTagNameNS(List list, Branch parent, String namespace, String localName)
           
static Attr asDOMAttr(Node attribute)
           
static Document asDOMDocument(Document document)
           
static DocumentType asDOMDocumentType(DocumentType dt)
           
static Element asDOMElement(Node element)
           
static Node asDOMNode(Node node)
           
static Text asDOMText(CharacterData text)
           
static Node cloneNode(Node node, boolean deep)
           
static NodeList createNodeList(List list)
           
static void deleteData(CharacterData charData, int offset, int count)
           
static NamedNodeMap getAttributes(Node node)
           
static NodeList getChildNodes(Node node)
           
static String getData(CharacterData charData)
           
static Node getFirstChild(Node node)
           
static Node getLastChild(Node node)
           
static int getLength(CharacterData charData)
           
static String getLocalName(Node node)
           
static String getNamespaceURI(Node node)
           
static Node getNextSibling(Node node)
           
static String getNodeValue(Node node)
           
static Document getOwnerDocument(Node node)
           
static Node getParentNode(Node node)
           
static String getPrefix(Node node)
           
static Node getPreviousSibling(Node node)
           
static boolean hasAttributes(Node node)
           
static boolean hasChildNodes(Node node)
           
static Node insertBefore(Node node, Node newChild, Node refChild)
           
static void insertData(CharacterData data, int offset, String arg)
           
static boolean isSupported(Node n, String feature, String version)
           
static void normalize(Node node)
           
static void notSupported()
          Called when a method has not been implemented yet
static Node removeChild(Node node, Node oldChild)
           
static Node replaceChild(Node node, Node newChild, Node oldChild)
           
static void replaceData(CharacterData charData, int offset, int count, String arg)
           
static void setData(CharacterData charData, String data)
           
static void setNodeValue(Node node, String nodeValue)
           
static void setPrefix(Node node, String prefix)
           
static String substringData(CharacterData charData, int offset, int count)
           
static boolean supports(Node node, String feature, String version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_NODE_LIST

public static final NodeList EMPTY_NODE_LIST
Constructor Detail

DOMNodeHelper

protected DOMNodeHelper()
Method Detail

supports

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

getNamespaceURI

public static String getNamespaceURI(Node node)

getPrefix

public static String getPrefix(Node node)

getLocalName

public static String getLocalName(Node node)

setPrefix

public static void setPrefix(Node node,
                             String prefix)
                      throws DOMException
Throws:
DOMException

getNodeValue

public static String getNodeValue(Node node)
                           throws DOMException
Throws:
DOMException

setNodeValue

public static void setNodeValue(Node node,
                                String nodeValue)
                         throws DOMException
Throws:
DOMException

getParentNode

public static Node getParentNode(Node node)

getChildNodes

public static NodeList getChildNodes(Node node)

getFirstChild

public static Node getFirstChild(Node node)

getLastChild

public static Node getLastChild(Node node)

getPreviousSibling

public static Node getPreviousSibling(Node node)

getNextSibling

public static Node getNextSibling(Node node)

getAttributes

public static NamedNodeMap getAttributes(Node node)

getOwnerDocument

public static Document getOwnerDocument(Node node)

insertBefore

public static Node insertBefore(Node node,
                                Node newChild,
                                Node refChild)
                         throws DOMException
Throws:
DOMException

replaceChild

public static Node replaceChild(Node node,
                                Node newChild,
                                Node oldChild)
                         throws DOMException
Throws:
DOMException

removeChild

public static Node removeChild(Node node,
                               Node oldChild)
                        throws DOMException
Throws:
DOMException

appendChild

public static Node appendChild(Node node,
                               Node newChild)
                        throws DOMException
Throws:
DOMException

hasChildNodes

public static boolean hasChildNodes(Node node)

cloneNode

public static Node cloneNode(Node node,
                             boolean deep)

normalize

public static void normalize(Node node)

isSupported

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

hasAttributes

public static boolean hasAttributes(Node node)

getData

public static String getData(CharacterData charData)
                      throws DOMException
Throws:
DOMException

setData

public static void setData(CharacterData charData,
                           String data)
                    throws DOMException
Throws:
DOMException

getLength

public static int getLength(CharacterData charData)

substringData

public static String substringData(CharacterData charData,
                                   int offset,
                                   int count)
                            throws DOMException
Throws:
DOMException

appendData

public static void appendData(CharacterData charData,
                              String arg)
                       throws DOMException
Throws:
DOMException

insertData

public static void insertData(CharacterData data,
                              int offset,
                              String arg)
                       throws DOMException
Throws:
DOMException

deleteData

public static void deleteData(CharacterData charData,
                              int offset,
                              int count)
                       throws DOMException
Throws:
DOMException

replaceData

public static void replaceData(CharacterData charData,
                               int offset,
                               int count,
                               String arg)
                        throws DOMException
Throws:
DOMException

appendElementsByTagName

public static void appendElementsByTagName(List list,
                                           Branch parent,
                                           String name)

appendElementsByTagNameNS

public static void appendElementsByTagNameNS(List list,
                                             Branch parent,
                                             String namespace,
                                             String localName)

createNodeList

public static NodeList createNodeList(List list)

asDOMNode

public static Node asDOMNode(Node node)

asDOMDocument

public static Document asDOMDocument(Document document)

asDOMDocumentType

public static DocumentType asDOMDocumentType(DocumentType dt)

asDOMText

public static Text asDOMText(CharacterData text)

asDOMElement

public static Element asDOMElement(Node element)

asDOMAttr

public static Attr asDOMAttr(Node attribute)

notSupported

public static void notSupported()
Called when a method has not been implemented yet

Throws:
DOMException - DOCUMENT ME!


Copyright © 2001-2005 MetaStuff Ltd.. All Rights Reserved.