public class Path extends Object
Two absolute paths can also be compared to calculate the relative path between them. A relative path can be applied to an absolute path to calculate another absolute path.
Note that the paths produced are XPath compliant, so can be read by other XPath engines. The following are examples of path expressions that the Path object supports:
Path a = new Path("/html/body/div/table[2]/tr[3]/td/div"); Path b = new Path("/html/body/div/table[2]/tr[6]/td/form"); Path relativePath = a.relativeTo(b); // produces: "../../../tr[6]/td/form" Path c = a.apply(relativePath); // same as Path b.
PathTracker
Constructor and Description |
---|
Path(String pathAsString) |
Path(String[] chunks) |
Modifier and Type | Method and Description |
---|---|
Path |
apply(Path relativePath) |
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isAncestor(Path child) |
Path |
relativeTo(Path that) |
String |
toString() |
public boolean isAncestor(Path child)
Copyright © 2016 Internet2. All rights reserved.