Package com.openhtmltopdf.css.extend.lib
Class DOMTreeResolver
java.lang.Object
com.openhtmltopdf.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 com.openhtmltopdf.css.extend.TreeResolver
NO_NAMESPACE -
Constructor Summary
Constructors Constructor Description DOMTreeResolver() -
Method Summary
Modifier and Type Method Description StringgetElementName(Object element)returns the name of the element so that it may match against the selectorsObjectgetParentElement(Object element)returns the parent element of an element, or null if this was the root elementintgetPositionOfElement(Object element)Returns the index of the position of the submitted element among its element node siblings.ObjectgetPreviousSiblingElement(Object element)The previous sibling element, or null if none existsbooleanisFirstChildElement(Object element)returns true if this element is the first child element of its parentbooleanisLastChildElement(Object element)returns true if this element is the last child element of its parentbooleanmatchesElement(Object element, String namespaceURI, String name)Returnstrueifelementhas the local namenameand namespace URInamespaceURI.
-
Constructor Details
-
DOMTreeResolver
public DOMTreeResolver()
-
-
Method Details
-
getParentElement
Description copied from interface:TreeResolverreturns the parent element of an element, or null if this was the root element- Specified by:
getParentElementin interfaceTreeResolver
-
getPreviousSiblingElement
Description copied from interface:TreeResolverThe previous sibling element, or null if none exists- Specified by:
getPreviousSiblingElementin interfaceTreeResolver
-
getElementName
Description copied from interface:TreeResolverreturns the name of the element so that it may match against the selectors- Specified by:
getElementNamein interfaceTreeResolver
-
isFirstChildElement
Description copied from interface:TreeResolverreturns true if this element is the first child element of its parent- Specified by:
isFirstChildElementin interfaceTreeResolver
-
isLastChildElement
Description copied from interface:TreeResolverreturns true if this element is the last child element of its parent- Specified by:
isLastChildElementin interfaceTreeResolver
-
matchesElement
Description copied from interface:TreeResolverReturnstrueifelementhas the local namenameand namespace URInamespaceURI.- Specified by:
matchesElementin interfaceTreeResolvernamespaceURI- 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
Description copied from interface:TreeResolverReturns the index of the position of the submitted element among its element node siblings.- Specified by:
getPositionOfElementin interfaceTreeResolver- Returns:
- -1 in case of error, 0 indexed position otherwise
-