Top Fields Methods
com.openhtmltopdf.css.extend

public Interface TreeResolver

Known Direct Implementers
com.openhtmltopdf.css.extend.lib.DOMTreeResolver

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

Modifier and TypeField and Description
public static final String

Method Summary

Modifier and TypeMethod and Description
public String
getElementName(Object element)

returns the name of the element so that it may match against the selectors

public Object
getParentElement(Object element)

returns the parent element of an element, or null if this was the root element

public int

Returns:

-1 in case of error, 0 indexed position otherwise
getPositionOfElement
(Object element)

Returns the index of the position of the submitted element among its element node siblings.

public Object
getPreviousSiblingElement(Object node)

The previous sibling element, or null if none exists

public boolean
isFirstChildElement(Object element)

returns true if this element is the first child element of its parent

public boolean
isLastChildElement(Object element)

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 NO_NAMESPACE to signify that name should only match when there is no namespace defined on element.
namespaceURI
,
String
The name to match, may not be null
name
)

Returns true if element has the local name name and namespace URI namespaceURI.

Field Detail

NO_NAMESPACEback to summary
public static final String NO_NAMESPACE

Method Detail

getElementNameback to summary
public String getElementName(Object element)

returns the name of the element so that it may match against the selectors

getParentElementback to summary
public Object getParentElement(Object element)

returns the parent element of an element, or null if this was the root element

getPositionOfElementback to summary
public int getPositionOfElement(Object element)

Returns the index of the position of the submitted element among its element node siblings.

Returns:int

-1 in case of error, 0 indexed position otherwise

getPreviousSiblingElementback to summary
public Object getPreviousSiblingElement(Object node)

The previous sibling element, or null if none exists

isFirstChildElementback to summary
public boolean isFirstChildElement(Object element)

returns true if this element is the first child element of its parent

isLastChildElementback to summary
public boolean isLastChildElement(Object element)

returns true if this element is the last child element of its parent

matchesElementback to summary
public boolean matchesElement(Object element, String namespaceURI, String name)

Returns true if element has the local name name and namespace URI namespaceURI.

Parameters
namespaceURI:String

The namespace to match, may be null to signify any namespace. Use NO_NAMESPACE to signify that name should only match when there is no namespace defined on element.

name:String

The name to match, may not be null