Package org.xhtmlrenderer.css.extend
Interface TreeResolver
- All Known Implementing Classes:
DOMTreeResolver
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.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetElementName
(Node element) returns the name of the element so that it may match against the selectorsgetParentElement
(Node element) returns the parent element of an element, or null if this was the root elementint
getPositionOfElement
(Node element) Returns the index of the position of the submitted element among its element node siblings.The previous sibling element, or null if none existsboolean
isFirstChildElement
(Node element) returns true if this element is the first child element of its parentboolean
isLastChildElement
(Node element) returns true if this element is the last child element of its parentboolean
matchesElement
(Node element, String namespaceURI, String name) Returnstrue
ifelement
has the local namename
and namespace URInamespaceURI
.
-
Field Details
-
NO_NAMESPACE
- See Also:
-
-
Method Details
-
getParentElement
returns the parent element of an element, or null if this was the root element -
getElementName
returns the name of the element so that it may match against the selectors -
getPreviousSiblingElement
The previous sibling element, or null if none exists -
isFirstChildElement
returns true if this element is the first child element of its parent -
isLastChildElement
returns true if this element is the last child element of its parent -
getPositionOfElement
Returns the index of the position of the submitted element among its element node siblings.- Parameters:
element
- The node- Returns:
- -1 in case of error, 0 indexed position otherwise
-
matchesElement
Returnstrue
ifelement
has the local namename
and namespace URInamespaceURI
.- Parameters:
element
- The nodenamespaceURI
- The namespace to match, may be null to signify any namespace. UseNO_NAMESPACE
to signify thatname
should only match when there is no namespace defined onelement
.name
- The name to match, may not be null
-