| Modifier and Type | Field and Description |
|---|---|
| private final Map | cachedPositions
We cache element positions for nth-child, odd and even condition matchers. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | getElementName(Object element)
Implements com. returns the name of the element so that it may match against the selectors |
| public Object | getParentElement(Object element)
Implements com. returns the parent element of an element, or null if this was the root element |
| public int | getPositionOfElement(Object element)
Implements com. Returns the index of the position of the submitted element among its element node siblings. |
| public Object | getPreviousSiblingElement(Object element)
Implements com. The previous sibling element, or null if none exists |
| public boolean | isFirstChildElement(Object element)
Implements com. returns true if this element is the first child element of its parent |
| public boolean | isLastChildElement(Object element)
Implements com. returns true if this element is the last child element of its parent |
| public boolean | matchesElement(Object element, String
The namespace to match, may be null to signify any
namespace. Use namespaceURI, String NO_NAMESPACE to signify that name
should only match when there is no namespace defined on element.The name to match, may not be null name)Implements com. Returns |
| cachedPositions | back to summary |
|---|---|
| private final Map<Node, Map<Node, Integer>> cachedPositions We cache element positions for nth-child, odd and even condition matchers. To avoid scaling with the square of the number of children elements. | |
| DOMTreeResolver | back to summary |
|---|---|
| public DOMTreeResolver() | |
| getElementName | back to summary |
|---|---|
| public String getElementName(Object element) Implements com. Doc from com. returns the name of the element so that it may match against the selectors
| |
| getParentElement | back to summary |
|---|---|
| public Object getParentElement(Object element) Implements com. Doc from com. returns the parent element of an element, or null if this was the root element
| |
| getPositionOfElement | back to summary |
|---|---|
| public int getPositionOfElement(Object element) Implements com. Doc from com. Returns the index of the position of the submitted element among its element node siblings.
| |
| getPreviousSiblingElement | back to summary |
|---|---|
| public Object getPreviousSiblingElement(Object element) Implements com. Doc from com. The previous sibling element, or null if none exists
| |
| isFirstChildElement | back to summary |
|---|---|
| public boolean isFirstChildElement(Object element) Implements com. Doc from com. returns true if this element is the first child element of its parent
| |
| isLastChildElement | back to summary |
|---|---|
| public boolean isLastChildElement(Object element) Implements com. Doc from com. returns true if this element is the last child element of its parent
| |
| matchesElement | back to summary |
|---|---|
| public boolean matchesElement(Object element, String namespaceURI, String name) Implements com. Doc from com. Returns
| |