public class ItsNatTreeWalker extends Object
Most of methods have been inspired by org.w3c.dom.traversal.TreeWalker.
| Constructor and Description |
|---|
ItsNatTreeWalker() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getChildElementCount(Node node)
Returns the number of child elements of the specified node.
|
static Element |
getFirstChildElement(Node node)
Returns the first direct child
org.w3c.dom.Element below the specified node. |
static Element |
getFirstChildElementWithTagName(Node parent,
String tagName)
Returns the first direct child element with the specified tag name.
|
static Element |
getFirstChildElementWithTagNameNS(Node parent,
String namespaceURI,
String localName)
Returns the first direct child element with the specified namespace and local name.
|
static Element |
getFirstDeepestChildElement(Node node)
Returns the first and deepest element below the specified node.
|
static Element |
getLastChildElement(Node node)
Returns the last direct child
org.w3c.dom.Element below the specified node. |
static Element |
getNextElement(Node node)
Returns the next
org.w3c.dom.Element following the specified node in document order. |
static Node |
getNextNode(Node node)
Returns the next node following the specified node in document order.
|
static Element |
getNextSiblingElement(Node node)
Returns the next sibling
org.w3c.dom.Element following the specified node. |
static Element |
getParentElement(Node node)
Returns the first parent
org.w3c.dom.Element of specified node. |
static Element |
getPreviousElement(Node node)
Returns the previous
org.w3c.dom.Element following the specified node in document order. |
static Node |
getPreviousNode(Node node)
Returns the previous node following the specified node in document order.
|
static Element |
getPreviousSiblingElement(Node node)
Returns the previous sibling
org.w3c.dom.Element following the specified node. |
static boolean |
hasChildElements(Node node)
Informs whether the specified node has child elements.
|
public static boolean hasChildElements(Node node)
node - the node to inspect.public static int getChildElementCount(Node node)
node - the node to inspect.public static Element getFirstChildElement(Node node)
org.w3c.dom.Element below the specified node.
Any child non-element is ignored.node - the node parent.public static Element getLastChildElement(Node node)
org.w3c.dom.Element below the specified node.
Any child non-element is ignored.node - the node parent.public static Element getNextSiblingElement(Node node)
org.w3c.dom.Element following the specified node.
Any non-element is ignored.node - the original node.public static Element getPreviousSiblingElement(Node node)
org.w3c.dom.Element following the specified node.
Any non-element is ignored.node - the original node.public static Element getParentElement(Node node)
org.w3c.dom.Element of specified node.
Any non-element parent is ignored.node - the original node.public static Element getPreviousElement(Node node)
org.w3c.dom.Element following the specified node in document order.
Any non-element is ignored.node - the original node.public static Element getNextElement(Node node)
org.w3c.dom.Element following the specified node in document order.
Any non-element is ignored.node - the original node.public static Node getPreviousNode(Node node)
node - the original node.public static Node getNextNode(Node node)
node - the original node.public static Element getFirstChildElementWithTagName(Node parent, String tagName)
parent - the parent node.tagName - the tag name to search for, the search is case sensitive.public static Element getFirstChildElementWithTagNameNS(Node parent, String namespaceURI, String localName)
parent - the parent node.namespaceURI - the namespace of the element to search for, the search is case sensitive.localName - the local name of the element to search for, the search is case sensitive.public static Element getFirstDeepestChildElement(Node node)
For instance if node is the <table> element:
<table>
<tbody>
<tr>
<td>One</td>
</tr>
<tr>
<td>Two</td>
</tr>
</tbody>
</table>
Returns the <td> element parent of One
node - the parent node to search.Copyright © Innowhere Software, Jose Maria Arranz Santamaria.