org.eclipse.actf.model.dom.locate
Class DomNodeLocator
java.lang.Object
org.eclipse.actf.model.locate.AbstractNodeLocator
org.eclipse.actf.model.dom.locate.DomNodeLocator
- All Implemented Interfaces:
- INodeLocator
public class DomNodeLocator
- extends AbstractNodeLocator
a locator for elements of a W3C DOM-compliant hierarchy
- Author:
- Mike Squillace
Fields inherited from class org.eclipse.actf.model.locate.AbstractNodeLocator |
CONTAINSSUBSTR_SEARCH, defaultIdPropName, EXACTMATCH_SEARCH, IGNORECASE_SEARCH, model, NODELOCATOR_VARIABLE, NODENAME_CHARCLASS, NODENAME_KEY, PREDICATEVAL_CHARCLASS, propertiesMap, REGEXP_SEARCH, ROOT_JXPATH_CONTEXT, SEGMENT_PATTERN |
Constructor Summary |
|
DomNodeLocator()
create an element locator for W3C DOM elements |
protected |
DomNodeLocator(String idPropName,
String modelName,
org.apache.commons.jxpath.ri.model.NodePointerFactory factory)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DomNodeLocator
public DomNodeLocator()
- create an element locator for W3C DOM elements
DomNodeLocator
protected DomNodeLocator(String idPropName,
String modelName,
org.apache.commons.jxpath.ri.model.NodePointerFactory factory)
locate
public String locate(Object element,
Object root)
- Description copied from class:
AbstractNodeLocator
- locate a component within a model from the given root. The returned
string represents an XPath location path that uniquely determines the component's location within the
graph starting with the given root. This method can be used in conjunction with
describey
to provide a
richer description of the component.
- Specified by:
locate
in interface INodeLocator
- Overrides:
locate
in class AbstractNodeLocator
- Parameters:
element
- element within a graph to be locatedroot
- - root from which element is to be located or null
if
element is to be found from a start node in the graph
- Returns:
- string that uniquely locates element within the model
- See Also:
- XPath specification
prependNodeSegment
protected void prependNodeSegment(StringBuffer buffer,
Node node)
getRelativePositionByName
protected int getRelativePositionByName(Node node)