Package org.xhtmlrenderer.css.extend.lib
Class DOMTreeResolver
- java.lang.Object
-
- org.xhtmlrenderer.css.extend.lib.DOMTreeResolver
-
- All Implemented Interfaces:
TreeResolver
public class DOMTreeResolver extends Object implements TreeResolver
- Author:
- scott
works for a w3c DOM tree
-
-
Field Summary
-
Fields inherited from interface org.xhtmlrenderer.css.extend.TreeResolver
NO_NAMESPACE
-
-
Constructor Summary
Constructors Constructor Description DOMTreeResolver()
-
Method Summary
All Methods Instance Methods Concrete 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 element)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.
-
-
-
Method Detail
-
getParentElement
public Node getParentElement(Node element)
Description copied from interface:TreeResolverreturns the parent element of an element, or null if this was the root element- Specified by:
getParentElementin interfaceTreeResolver
-
getPreviousSiblingElement
public Node getPreviousSiblingElement(Node element)
Description copied from interface:TreeResolverThe previous sibling element, or null if none exists- Specified by:
getPreviousSiblingElementin interfaceTreeResolver
-
getElementName
public String getElementName(Node element)
Description copied from interface:TreeResolverreturns the name of the element so that it may match against the selectors- Specified by:
getElementNamein interfaceTreeResolver
-
isFirstChildElement
public boolean isFirstChildElement(Node element)
Description copied from interface:TreeResolverreturns true if this element is the first child element of its parent- Specified by:
isFirstChildElementin interfaceTreeResolver
-
isLastChildElement
public boolean isLastChildElement(Node element)
Description copied from interface:TreeResolverreturns true if this element is the last child element of its parent- Specified by:
isLastChildElementin interfaceTreeResolver
-
matchesElement
public boolean matchesElement(Node element, String namespaceURI, String name)
Description copied from interface:TreeResolverReturnstrueifelementhas the local namenameand namespace URInamespaceURI.- Specified by:
matchesElementin interfaceTreeResolver- Parameters:
element- The nodenamespaceURI- The namespace to match, may be null to signify any namespace. UseTreeResolver.NO_NAMESPACEto signify thatnameshould only match when there is no namespace defined onelement.name- The name to match, may not be null
-
getPositionOfElement
public int getPositionOfElement(Node element)
Description copied from interface:TreeResolverReturns the index of the position of the submitted element among its element node siblings.- Specified by:
getPositionOfElementin interfaceTreeResolver- Parameters:
element- The node- Returns:
- -1 in case of error, 0 indexed position otherwise
-
-