public class TreeWalker extends HtmlUnitScriptable
TreeWalker
.org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
NOT_FOUND
Constructor and Description |
---|
TreeWalker()
Creates an instance.
|
TreeWalker(Node root,
int whatToShow,
org.w3c.dom.traversal.NodeFilter filter,
boolean expandEntityReferences)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
Node |
firstChild()
Moves the TreeWalker to the first visible child of the current node,
and returns the new node.
|
Node |
getCurrentNode()
Gets the node at which the TreeWalker is currently positioned.
|
Object |
getFilter()
Gets the filter used to screen nodes.
|
Node |
getRoot()
Gets the root node of the TreeWalker, as specified when it was created.
|
long |
getWhatToShow()
Gets the whatToShow attribute of the TreeWalker.
|
void |
jsConstructor()
Creates an instance.
|
Node |
lastChild()
Moves the TreeWalker to the last visible child of the current node,
and returns the new node.
|
Node |
nextNode()
Moves the TreeWalker to the next visible node in document order
relative to the current node, and returns the new node.
|
Node |
nextSibling()
Moves the TreeWalker to the next sibling of the current node, and
returns the new node.
|
Node |
parentNode()
Moves to and returns the closest visible ancestor node of the current
node.
|
Node |
previousNode()
Moves the TreeWalker to the previous visible node in document order
relative to the current node, and returns the new node.
|
Node |
previousSibling()
Moves the TreeWalker to the previous sibling of the current node, and
returns the new node.
|
void |
setCurrentNode(Node currentNode)
Sets the node at which the TreeWalker is currently positioned.
|
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getWindow, getWindow, getWindowFromTopCallScope, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
public TreeWalker()
public TreeWalker(Node root, int whatToShow, org.w3c.dom.traversal.NodeFilter filter, boolean expandEntityReferences) throws DOMException
root
- The root node of the TreeWalker. Must not be
null
.whatToShow
- Flag specifying which types of nodes appear in the
logical view of the TreeWalker. See NodeFilter
for the
set of possible Show_ values.filter
- The NodeFilter
to be used with this TreeWalker,
or null
to indicate no filter.expandEntityReferences
- If false, the contents of
EntityReference nodes are not present in the logical view.DOMException
- on attempt to create a TreeWalker with a root that
is null
.DOMException
public void jsConstructor()
public Node getRoot()
public long getWhatToShow()
NodeFilter
.public Object getFilter()
public Node getCurrentNode()
public void setCurrentNode(Node currentNode) throws DOMException
currentNode
- The node to be used as the current position of the
TreeWalker.DOMException
- on attempt to set currentNode to
null
.DOMException
public Node parentNode()
null
if the current node
has no parent in the TreeWalker's logical view.public Node firstChild()
null
, and retains the current node.null
if the current node has no
visible children in the TreeWalker's logical view.public Node lastChild()
null
, and retains the current node.null
if the current node has no
visible children in the TreeWalker's logical view.public Node previousSibling()
null
, and retains the current node.null
if the current node has no
previous sibling in the TreeWalker's logical view.public Node nextSibling()
null
, and retains the current node.null
if the current node has no
next sibling in the TreeWalker's logical view.public Node previousNode()
null
, and retains the current node.null
if the current node has no
previous node in the TreeWalker's logical view.public Node nextNode()
null
, and
retains the current node.null
if the current node has no
next node in the TreeWalker's logical view.Copyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.