Class ChildNode
- java.lang.Object
-
- org.htmlunit.cyberneko.xerces.dom.NodeImpl
-
- org.htmlunit.cyberneko.xerces.dom.ChildNode
-
- All Implemented Interfaces:
java.lang.Cloneable
,org.w3c.dom.events.EventTarget
,org.w3c.dom.Node
,org.w3c.dom.NodeList
- Direct Known Subclasses:
CharacterDataImpl
,ParentNode
public abstract class ChildNode extends NodeImpl
ChildNode inherits from NodeImpl and adds the capability of being a child by having references to its previous and next siblings.
-
-
Field Summary
Fields Modifier and Type Field Description protected ChildNode
nextSibling_
Next sibling.protected ChildNode
previousSibling_
Previous sibling.-
Fields inherited from class org.htmlunit.cyberneko.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, FIRSTCHILD, HASSTRING, ID, NORMALIZED, OWNED, ownerNode_, READONLY, SPECIFIED, SYNCCHILDREN
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ChildNode(CoreDocumentImpl ownerDocument)
No public constructor; only subclasses of Node should be instantiated, and those normally via a Document's factory methods
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.dom.Node
cloneNode(boolean deep)
Returns a duplicate of a given node.org.w3c.dom.Node
getNextSibling()
The next child of this node's parent, or null if noneorg.w3c.dom.Node
getParentNode()
Obtain the DOM-tree parent of this node, or null if it is not currently active in the DOM tree (perhaps because it has just been created or removed).org.w3c.dom.Node
getPreviousSibling()
The previous child of this node's parent, or null if none(package private) NodeImpl
parentNode()
(package private) ChildNode
previousSibling()
-
Methods inherited from class org.htmlunit.cyberneko.xerces.dom.NodeImpl
addEventListener, appendChild, changed, changes, compareDocumentPosition, dispatchEvent, getAttributes, getBaseURI, getChildNodes, getElementAncestor, getFeature, getFirstChild, getLastChild, getLength, getLocalName, getNamespaceURI, getNodeName, getNodeNumber, getNodeType, getNodeValue, getOwnerDocument, getPrefix, getTextContent, getTextContent, getUserData, hasAttributes, hasChildNodes, hasStringValue, hasStringValue, insertBefore, isDefaultNamespace, isEqualNode, isFirstChild, isFirstChild, isIdAttribute, isIdAttribute, isNormalized, isNormalized, isOwned, isOwned, isSameNode, isSpecified, isSpecified, isSupported, item, lookupNamespacePrefix, lookupNamespaceURI, lookupPrefix, needsSyncChildren, needsSyncChildren, normalize, ownerDocument, removeChild, removeEventListener, replaceChild, setNodeValue, setOwnerDocument, setPrefix, setTextContent, setUserData, toString
-
-
-
-
Constructor Detail
-
ChildNode
protected ChildNode(CoreDocumentImpl ownerDocument)
No public constructor; only subclasses of Node should be instantiated, and those normally via a Document's factory methodsEvery Node knows what Document it belongs to.
- Parameters:
ownerDocument
- the owner document
-
-
Method Detail
-
cloneNode
public org.w3c.dom.Node cloneNode(boolean deep)
Returns a duplicate of a given node. You can consider this a generic "copy constructor" for nodes. The newly returned object should be completely independent of the source object's subtree, so changes in one after the clone has been made will not affect the other.Note: since we never have any children deep is meaningless here, ParentNode overrides this behavior. Returns a duplicate of a given node. You can consider this a generic "copy constructor" for nodes. The newly returned object should be completely independent of the source object's subtree, so changes in one after the clone has been made will not affect the other.
Note: since we never have any children deep is meaningless here, ParentNode overrides this behavior.
- Specified by:
cloneNode
in interfaceorg.w3c.dom.Node
- Overrides:
cloneNode
in classNodeImpl
- See Also:
Example: Cloning a Text node will copy both the node and the text it contains. Example: Cloning something that has children -- Element or Attr, for example -- will _not_ clone those children unless a "deep clone" has been requested. A shallow clone of an Attr node will yield an empty Attr of the same name. NOTE: Clones will always be read/write, even if the node being cloned is read-only, to permit applications using only the DOM API to obtain editable copies of locked portions of the tree.
-
getParentNode
public org.w3c.dom.Node getParentNode()
Obtain the DOM-tree parent of this node, or null if it is not currently active in the DOM tree (perhaps because it has just been created or removed). Note that Document, DocumentFragment, and Attribute will never have parents.- Specified by:
getParentNode
in interfaceorg.w3c.dom.Node
- Overrides:
getParentNode
in classNodeImpl
-
parentNode
final NodeImpl parentNode()
- Overrides:
parentNode
in classNodeImpl
-
getNextSibling
public org.w3c.dom.Node getNextSibling()
The next child of this node's parent, or null if none The next child of this node's parent, or null if none- Specified by:
getNextSibling
in interfaceorg.w3c.dom.Node
- Overrides:
getNextSibling
in classNodeImpl
-
getPreviousSibling
public org.w3c.dom.Node getPreviousSibling()
The previous child of this node's parent, or null if none- Specified by:
getPreviousSibling
in interfaceorg.w3c.dom.Node
- Overrides:
getPreviousSibling
in classNodeImpl
-
previousSibling
final ChildNode previousSibling()
- Overrides:
previousSibling
in classNodeImpl
-
-