Class NodeImpl

  • All Implemented Interfaces:
    java.io.Serializable, org.w3c.dom.Node
    Direct Known Subclasses:
    Attribute, CharacterDataImpl, Property

    public abstract class NodeImpl
    extends java.lang.Object
    implements org.w3c.dom.Node, java.io.Serializable
    Basic implementation of the Node interface. Each descendant, except for those that implement the Document interface, should follow the general contract:
    • doc = null
      • parent = null -> the Node has neither a parent nor a Document. This might be a brand new Node not yet attached to an Element.
      • parent != null -> the Node has a parent but its parent or the top-most parent is not attached to a Document.
    • doc != null
      • parent = null -> this is an Element node attached directly to the Document
      • parent != null -> this is a node which up the hierarchy has a parent attached to a Document
    Since:
    7.0
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Attribute parent
      This private variable holds a reference to the parent of this element.
      • Fields inherited from interface org.w3c.dom.Node

        ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeImpl()  
    • Field Detail

      • parent

        protected transient Attribute parent
        This private variable holds a reference to the parent of this element.
    • Constructor Detail

      • NodeImpl

        public NodeImpl()
    • Method Detail

      • appendChild

        public org.w3c.dom.Node appendChild​(org.w3c.dom.Node newChild)
                                     throws DOMException
        This private variable holds a reference to the document of this element.
        Specified by:
        appendChild in interface org.w3c.dom.Node
        Throws:
        DOMException
      • compareDocumentPosition

        public short compareDocumentPosition​(org.w3c.dom.Node other)
                                      throws DOMException
        Does nothing!
        Specified by:
        compareDocumentPosition in interface org.w3c.dom.Node
        Parameters:
        other -
        Returns:
        0
        Throws:
        DOMException - - never
      • getAttributes

        public org.w3c.dom.NamedNodeMap getAttributes()
        Specified by:
        getAttributes in interface org.w3c.dom.Node
        Returns:
        PropertyMap object, that contains all the properties of this Attribute.
      • getBaseURI

        public java.lang.String getBaseURI()
        Does Nothing!
        Specified by:
        getBaseURI in interface org.w3c.dom.Node
        Returns:
        null;
      • getFeature

        public java.lang.Object getFeature​(java.lang.String feature,
                                           java.lang.String version)
        Does Nothing!
        Specified by:
        getFeature in interface org.w3c.dom.Node
        Parameters:
        version -
        feature -
        Returns:
        Boolean.FALSE
      • getNodeName

        public java.lang.String getNodeName()
        Specified by:
        getNodeName in interface org.w3c.dom.Node
      • getOwnerDocument

        public org.w3c.dom.Document getOwnerDocument()
        Specified by:
        getOwnerDocument in interface org.w3c.dom.Node
      • getParentNode

        public Attribute getParentNode()
        Specified by:
        getParentNode in interface org.w3c.dom.Node
      • getTextContent

        public java.lang.String getTextContent()
                                        throws DOMException
        Specified by:
        getTextContent in interface org.w3c.dom.Node
        Throws:
        DOMException
      • getUserData

        public java.lang.Object getUserData​(java.lang.String key)
        Does nothing!
        Specified by:
        getUserData in interface org.w3c.dom.Node
        Parameters:
        key -
        Returns:
        null
      • hasAttributes

        public boolean hasAttributes()
        Specified by:
        hasAttributes in interface org.w3c.dom.Node
      • hasChildNodes

        public boolean hasChildNodes()
        Specified by:
        hasChildNodes in interface org.w3c.dom.Node
      • insertBefore

        public org.w3c.dom.Node insertBefore​(org.w3c.dom.Node newChild,
                                             org.w3c.dom.Node refChild)
                                      throws DOMException
        Specified by:
        insertBefore in interface org.w3c.dom.Node
        Throws:
        DOMException
      • isDefaultNamespace

        public boolean isDefaultNamespace​(java.lang.String namespaceURI)
        Specified by:
        isDefaultNamespace in interface org.w3c.dom.Node
      • internalNSLookup

        protected java.lang.String internalNSLookup​(java.lang.String prefix)
      • isEqualNode

        public boolean isEqualNode​(org.w3c.dom.Node other)
        Specified by:
        isEqualNode in interface org.w3c.dom.Node
      • isSameNode

        public boolean isSameNode​(org.w3c.dom.Node other)
        Specified by:
        isSameNode in interface org.w3c.dom.Node
      • isSupported

        public boolean isSupported​(java.lang.String feature,
                                   java.lang.String version)
        Does nothing!
        Specified by:
        isSupported in interface org.w3c.dom.Node
        Parameters:
        feature -
        version -
        Returns:
        false
      • lookupNamespaceURI

        public java.lang.String lookupNamespaceURI​(java.lang.String prefix)
        Specified by:
        lookupNamespaceURI in interface org.w3c.dom.Node
      • lookupPrefix

        public java.lang.String lookupPrefix​(java.lang.String namespaceURI)
        Specified by:
        lookupPrefix in interface org.w3c.dom.Node
      • internalLookupPrefix

        protected java.lang.String internalLookupPrefix​(java.lang.String namespaceURI)
      • normalize

        public void normalize()
        Not Supported!
        Specified by:
        normalize in interface org.w3c.dom.Node
      • removeChild

        public org.w3c.dom.Node removeChild​(org.w3c.dom.Node oldChild)
                                     throws DOMException
        Specified by:
        removeChild in interface org.w3c.dom.Node
        Throws:
        DOMException
      • replaceChild

        public org.w3c.dom.Node replaceChild​(org.w3c.dom.Node newChild,
                                             org.w3c.dom.Node oldChild)
        Specified by:
        replaceChild in interface org.w3c.dom.Node
      • setTextContent

        public void setTextContent​(java.lang.String textContent)
        Specified by:
        setTextContent in interface org.w3c.dom.Node
      • setUserData

        public java.lang.Object setUserData​(java.lang.String key,
                                            java.lang.Object data,
                                            org.w3c.dom.UserDataHandler handler)
        Does nothing!
        Specified by:
        setUserData in interface org.w3c.dom.Node
        Parameters:
        key -
        data -
        handler -
        Returns:
        null
      • getChildNodes

        public org.w3c.dom.NodeList getChildNodes()
        Specified by:
        getChildNodes in interface org.w3c.dom.Node
      • getFirstChild

        public org.w3c.dom.Node getFirstChild()
        Specified by:
        getFirstChild in interface org.w3c.dom.Node
      • getLastChild

        public org.w3c.dom.Node getLastChild()
        Specified by:
        getLastChild in interface org.w3c.dom.Node
      • getNextSibling

        public org.w3c.dom.Node getNextSibling()
        Specified by:
        getNextSibling in interface org.w3c.dom.Node
      • getPreviousSibling

        public org.w3c.dom.Node getPreviousSibling()
        Specified by:
        getPreviousSibling in interface org.w3c.dom.Node