Class Path
- java.lang.Object
- com.orchestranetworks.schema.Path
 
- All Implemented Interfaces:
- Comparable<Path>
 
 - public abstract class Path extends Object implements Comparable<Path> A path is used for locating a node in a tree structure. It consists of a sequence of steps.- In string notation, the steps are separated by " - /" slashes. The syntax supported is in fact a small subset of XPath:- A path that begins with "/" is an absolute location, otherwise, it is a relative location.
- Special steps are "." (the self node) and ".." (the parent node).
 - Examples- The path /domain/customer/lastNameis an absolute location.
- The path ../customer/lastNameis a relative location that starts at the parent of the current node.
- The paths ./customer/lastNameandcustomer/lastNameare both relative locations that start at the current (self) node and are equivalent.
 
-   Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Pathadd (Path aPath)Concatenates this path instance with the path specified.abstract Pathadd (Step aStep)abstract Pathadd (String aKey)abstract PathaddIndex (int index)Returns a path such that the last step is indexed with the specified number.abstract PathaddIndexedPath (Path aPath, int index)Concatenates this path instance with the specified indexed path.abstract PathaddIndexedStep (Step aStep, int index)Concatenates this path instance with the specified indexed step.abstract Stringformat()Returns the canonical string representation of this instance.abstract StepgetFirstStep()Returns the first step of this path,nullfor the root path.abstract StepgetLastStep()Returns the last step of this path,nullfor the root path.abstract PathgetPathWithoutLastStep()Returns this path without its last step.abstract intgetSize()Returns the number of steps in this path.abstract StepgetStep (int i)Returns the step at the specified position in this path.abstract Step[]getSteps()Returns the array of steps for this path.abstract PathgetSubPath (int beginIndex)Returns a new path that is a subpath of this path.abstract PathgetSubPath (int beginIndex, int endIndex)Returns a new path that is a subpath of this path.booleanisIndexed()Returnstrueif thisPathidentifies a node in an aggregated list.abstract booleanisRelative()Returnstrueif this path begins with '.'abstract booleanisRoot()Returnstrueif this is the root path (whose canonical notation is "/").abstract booleanisSelf()Returnstrueif this is the self path (whose canonical notation is ".").static Pathparse (String pathString)Returns the path based on the string specified.abstract PathresolveWith (Path aPath)Resolves the path specified against this instance by considering that this instance is the "current location".booleanstartsWith (Path aPath)Tests whether this path starts with the specified prefix.abstract booleanstartsWith (Path aPath, int offset)Tests whether this path starts with the specified prefix beginning at specified index.-   Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 -   Methods inherited from interface java.lang.ComparablecompareTo
 
-   
 
-   
-   Method Detail- parse- public static Path parse(String pathString) Returns the path based on the string specified.- This method also performs path simplification whenever possible, if the path includes " - ." or "- ..".
 - add- public abstract Path add(Path aPath) Concatenates this path instance with the path specified. This method also performs path simplification if the specified path begins with "- ." or "- ..".- Examples: - this- aPath- result - /a/b/c - /d/e - /a/b/c/d/e - /a/b/c - . - /a/b/c - /a/b/c - ./d/e - /a/b/c/d/e - /a/b/c - ../d/e - /a/b/d/e - /a/b/c - .. - /a/b - /a/b/c - ../.. - /a - /a/b/c - ../../.. - / - /a/b/c - ../../../.. - .. - /a/b/c - ../../../../d/e - ../d/e - /a/b/c - ../../.. - / - . - /a/b/c - ./a/b/c - . - .. - .. - See Also:
- resolveWith(Path)
 
 - addIndex- public abstract Path addIndex(int index) - Returns a path such that the last step is indexed with the specified number. - For example, if this instance is - /customer/addressand it receives- addIndex(2), then the resulting path is- /customer/address[2].- This notation is only allowed on aggregated lists, not on tables. Contrary to the XPath specification, the index starts at 0 instead of 1. - Throws:
- IllegalStateException- if the last step of this path is already indexed.
- IllegalArgumentException- if- indexis negative.
- See Also:
- addIndexedPath(Path, int),- addIndexedStep(Step, int)
 
 - addIndexedStep- public abstract Path addIndexedStep(Step aStep, int index) Concatenates this path instance with the specified indexed step.- For example, if this instance is - /customerand it receives- addIndexedStep(Step('address'),2), then the resulting path is- /customer/address[2].- This notation is only allowed on aggregated lists, not on tables. Contrary to the XPath specification, index starts at 0 instead of 1. - This method is equivalent to @throws IllegalStateException if- add(aStep).addIndex(index)- .- aStepis already indexed.- Throws:
- IllegalArgumentException- if- indexis negative.
- See Also:
- isIndexed(),- addIndex(int),- addIndexedPath(Path, int)
 
 - addIndexedPath- public abstract Path addIndexedPath(Path aPath, int index) - Concatenates this path instance with the specified indexed path. - For example, if this instance is - /itemand it receives- addIndexedPath(Path('/customer/address'),2), then the resulting path is- /item/customer/address[2].- This notation is only allowed on aggregated lists, not on tables. Contrary to the XPath specification, index starts at 0 instead of 1. - This method is equivalent to @throws IllegalStateException if the last step of- add(aPath).addIndex(index)- .- aPathis already indexed.- Throws:
- IllegalArgumentException- if- indexis negative.
- See Also:
- isIndexed(),- addIndexedStep(Step, int),- addIndex(int)
 
 - getFirstStep- public abstract Step getFirstStep() Returns the first step of this path,- nullfor the root path.
 - resolveWith- public abstract Path resolveWith(Path aPath) Resolves the path specified against this instance by considering that this instance is the "current location".- Returns:
- if aPathis absolute then it returnsaPath(no relative resolution); ifaPathis relative then it returnsthis.add(aPath)
- See Also:
- add(Path)
 
 - getStep- public abstract Step getStep(int i) Returns the step at the specified position in this path.
 - getSteps- public abstract Step[] getSteps() Returns the array of steps for this path.
 - getLastStep- public abstract Step getLastStep() Returns the last step of this path,- nullfor the root path.
 - getPathWithoutLastStep- public abstract Path getPathWithoutLastStep() Returns this path without its last step.- Examples and special cases: - for /a/b/c, it returns/a/b
- for /, it returnsnull
- for ., it returns/
- for .., it returns/
 
- for 
 - getSubPath- public abstract Path getSubPath(int beginIndex) Returns a new path that is a subpath of this path. The subpath begins at the specified key and continues to the end of this path.
 - getSubPath- public abstract Path getSubPath(int beginIndex, int endIndex) Returns a new path that is a subpath of this path. The subpath begins at the specified- beginIndexkey and continues to the key at index- endIndex - 1. Thus, the size of the subpath is- endIndex - beginIndex.
 - startsWith- public boolean startsWith(Path aPath) Tests whether this path starts with the specified prefix.
 - startsWith- public abstract boolean startsWith(Path aPath, int offset) Tests whether this path starts with the specified prefix beginning at specified index.
 - getSize- public abstract int getSize() Returns the number of steps in this path.- A relative notation with - SELFalways counts- SELFas the first step. For example, for the notation- a/b/c, this method returns '4' since the path is interpreted as- ./a/b/c.
 - isIndexed- public final boolean isIndexed() Returns- trueif this- Pathidentifies a node in an aggregated list. For example, the path- element/item[0]/labelor- element/item/label[0]identifies a node under an aggregated list.- See Also:
- Step.isIndexed(),- Step.getIndex()
 
 - isRelative- public abstract boolean isRelative() Returns- trueif this path begins with '.' (self) or '..' (parent).
 - isRoot- public abstract boolean isRoot() Returns- trueif this is the root path (whose canonical notation is "- /").
 - isSelf- public abstract boolean isSelf() Returns- trueif this is the self path (whose canonical notation is "- .").
 - format- public abstract String format() Returns the canonical string representation of this instance.- Examples: - /a/b/cis an absolute path notation,- ./a/b/cis the notation for a relative path starting with the self node,- ../a/b/cis the notation for a relative path starting with the parent node.- See Also:
- parse(String)
 
 
 
-