Package org.dom4j.dom

Class DOMNodeHelper


  • public class DOMNodeHelper
    extends java.lang.Object

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

    • Field Detail

      • EMPTY_NODE_LIST

        public static final org.w3c.dom.NodeList EMPTY_NODE_LIST
    • Constructor Detail

      • DOMNodeHelper

        protected DOMNodeHelper()
    • Method Detail

      • supports

        public static boolean supports(Node node,
                                       java.lang.String feature,
                                       java.lang.String version)
      • getNamespaceURI

        public static java.lang.String getNamespaceURI(Node node)
      • getPrefix

        public static java.lang.String getPrefix(Node node)
      • getLocalName

        public static java.lang.String getLocalName(Node node)
      • setPrefix

        public static void setPrefix(Node node,
                                     java.lang.String prefix)
                              throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • getNodeValue

        public static java.lang.String getNodeValue(Node node)
                                             throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • setNodeValue

        public static void setNodeValue(Node node,
                                        java.lang.String nodeValue)
                                 throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • getParentNode

        public static org.w3c.dom.Node getParentNode(Node node)
      • getChildNodes

        public static org.w3c.dom.NodeList getChildNodes(Node node)
      • getFirstChild

        public static org.w3c.dom.Node getFirstChild(Node node)
      • getLastChild

        public static org.w3c.dom.Node getLastChild(Node node)
      • getPreviousSibling

        public static org.w3c.dom.Node getPreviousSibling(Node node)
      • getNextSibling

        public static org.w3c.dom.Node getNextSibling(Node node)
      • getAttributes

        public static org.w3c.dom.NamedNodeMap getAttributes(Node node)
      • getOwnerDocument

        public static org.w3c.dom.Document getOwnerDocument(Node node)
      • insertBefore

        public static org.w3c.dom.Node insertBefore(Node node,
                                                    org.w3c.dom.Node newChild,
                                                    org.w3c.dom.Node refChild)
                                             throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • replaceChild

        public static org.w3c.dom.Node replaceChild(Node node,
                                                    org.w3c.dom.Node newChild,
                                                    org.w3c.dom.Node oldChild)
                                             throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • removeChild

        public static org.w3c.dom.Node removeChild(Node node,
                                                   org.w3c.dom.Node oldChild)
                                            throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • appendChild

        public static org.w3c.dom.Node appendChild(Node node,
                                                   org.w3c.dom.Node newChild)
                                            throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • hasChildNodes

        public static boolean hasChildNodes(Node node)
      • cloneNode

        public static org.w3c.dom.Node cloneNode(Node node,
                                                 boolean deep)
      • normalize

        public static void normalize(Node node)
      • isSupported

        public static boolean isSupported(Node n,
                                          java.lang.String feature,
                                          java.lang.String version)
      • hasAttributes

        public static boolean hasAttributes(Node node)
      • getData

        public static java.lang.String getData(CharacterData charData)
                                        throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • setData

        public static void setData(CharacterData charData,
                                   java.lang.String data)
                            throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • getLength

        public static int getLength(CharacterData charData)
      • substringData

        public static java.lang.String substringData(CharacterData charData,
                                                     int offset,
                                                     int count)
                                              throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • appendData

        public static void appendData(CharacterData charData,
                                      java.lang.String arg)
                               throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • insertData

        public static void insertData(CharacterData data,
                                      int offset,
                                      java.lang.String arg)
                               throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • deleteData

        public static void deleteData(CharacterData charData,
                                      int offset,
                                      int count)
                               throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • replaceData

        public static void replaceData(CharacterData charData,
                                       int offset,
                                       int count,
                                       java.lang.String arg)
                                throws org.w3c.dom.DOMException
        Throws:
        org.w3c.dom.DOMException
      • appendElementsByTagName

        public static void appendElementsByTagName(java.util.List<? super Element> list,
                                                   Branch parent,
                                                   java.lang.String name)
      • appendElementsByTagNameNS

        public static void appendElementsByTagNameNS(java.util.List<? super Element> list,
                                                     Branch parent,
                                                     java.lang.String namespace,
                                                     java.lang.String localName)
      • createNodeList

        public static org.w3c.dom.NodeList createNodeList(java.util.List<Node> list)
      • asDOMNode

        public static org.w3c.dom.Node asDOMNode(Node node)
      • asDOMDocument

        public static org.w3c.dom.Document asDOMDocument(Document document)
      • asDOMDocumentType

        public static org.w3c.dom.DocumentType asDOMDocumentType(DocumentType dt)
      • asDOMText

        public static org.w3c.dom.Text asDOMText(CharacterData text)
      • asDOMElement

        public static org.w3c.dom.Element asDOMElement(Node element)
      • asDOMAttr

        public static org.w3c.dom.Attr asDOMAttr(Node attribute)
      • notSupported

        public static void notSupported()
        Called when a method has not been implemented yet
        Throws:
        org.w3c.dom.DOMException - DOCUMENT ME!
      • isStringEquals

        public static boolean isStringEquals(java.lang.String string1,
                                             java.lang.String string2)
      • isNodeEquals

        public static boolean isNodeEquals(org.w3c.dom.Node node1,
                                           org.w3c.dom.Node node2)
      • isNodeSame

        public static boolean isNodeSame(org.w3c.dom.Node node1,
                                         org.w3c.dom.Node node2)