public interface TreeResolver
Gives the css matcher access to the information it needs about the tree structure.
Elements are the "things" in the tree structure that can be matched by the matcher.
| Modifier and Type | Field and Description |
|---|---|
static String |
NO_NAMESPACE |
| Modifier and Type | Method and Description |
|---|---|
String |
getElementName(Node element)
returns the name of the element so that it may match against the selectors
|
Node |
getParentElement(Node element)
returns the parent element of an element, or null if this was the root element
|
int |
getPositionOfElement(Node element)
Returns the index of the position of the submitted element among its element node siblings.
|
Node |
getPreviousSiblingElement(Node node)
The previous sibling element, or null if none exists
|
boolean |
isFirstChildElement(Node element)
returns true if this element is the first child element of its parent
|
boolean |
isLastChildElement(Node element)
returns true if this element is the last child element of its parent
|
boolean |
matchesElement(Node element,
String namespaceURI,
String name)
Returns
true if element has the local name
name and namespace URI namespaceURI. |
static final String NO_NAMESPACE
Node getParentElement(Node element)
String getElementName(Node element)
Node getPreviousSiblingElement(Node node)
boolean isFirstChildElement(Node element)
boolean isLastChildElement(Node element)
int getPositionOfElement(Node element)
element - The nodeboolean matchesElement(Node element, String namespaceURI, String name)
true if element has the local name
name and namespace URI namespaceURI.element - The nodenamespaceURI - The namespace to match, may be null to signify any
namespace. Use NO_NAMESPACE to signify that name
should only match when there is no namespace defined on element.name - The name to match, may not be nullCopyright © 2023. All rights reserved.