Package org.xhtmlrenderer.css.extend
Interface TreeResolver
-
- All Known Implementing Classes:
DOMTreeResolver
public interface TreeResolver- Author:
- scott
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 Modifier and Type Field Description static StringNO_NAMESPACE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetElementName(Node element)returns the name of the element so that it may match against the selectorsNodegetParentElement(Node element)returns the parent element of an element, or null if this was the root elementintgetPositionOfElement(Node element)Returns the index of the position of the submitted element among its element node siblings.NodegetPreviousSiblingElement(Node node)The previous sibling element, or null if none existsbooleanisFirstChildElement(Node element)returns true if this element is the first child element of its parentbooleanisLastChildElement(Node element)returns true if this element is the last child element of its parentbooleanmatchesElement(Node element, String namespaceURI, String name)Returnstrueifelementhas the local namenameand namespace URInamespaceURI.
-
-
-
Field Detail
-
NO_NAMESPACE
static final String NO_NAMESPACE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getParentElement
Node getParentElement(Node element)
returns the parent element of an element, or null if this was the root element
-
getElementName
String getElementName(Node element)
returns the name of the element so that it may match against the selectors
-
getPreviousSiblingElement
Node getPreviousSiblingElement(Node node)
The previous sibling element, or null if none exists
-
isFirstChildElement
boolean isFirstChildElement(Node element)
returns true if this element is the first child element of its parent
-
isLastChildElement
boolean isLastChildElement(Node element)
returns true if this element is the last child element of its parent
-
getPositionOfElement
int getPositionOfElement(Node element)
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
boolean matchesElement(Node element, String namespaceURI, String name)
Returnstrueifelementhas the local namenameand namespace URInamespaceURI.- Parameters:
element- The nodenamespaceURI- The namespace to match, may be null to signify any namespace. UseNO_NAMESPACEto signify thatnameshould only match when there is no namespace defined onelement.name- The name to match, may not be null
-
-