|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.oxygenxml.validate.nvdl.Path
class Path
Stores a NVDL/NRL path information. Parses a path string and returns a list of Path objects. This stores a single path that can optionally start with a / and contains a list of local names separated by /, like /path1/path2 or path1/path2.
Nested Class Summary | |
---|---|
(package private) static class |
Path.ParseException
Exception thrown in case we get errors parsing a path. |
Field Summary | |
---|---|
private static int |
AFTER_NAME
After a local name. |
private static int |
AFTER_SLASH
After a slash. |
private static int |
IN_NAME
In a local name. |
private Vector |
names
The list of local names that form the path. |
private boolean |
root
Flag indicating wether the path starts with / or not. |
private static int |
START
Initial state. |
Constructor Summary | |
---|---|
Path(boolean root,
Vector names)
Constructor, creates a Path. |
Method Summary | |
---|---|
(package private) Vector |
getNames()
Get the local names list. |
(package private) boolean |
isRoot()
Determines if the path starts with / or not. |
static void |
main(String[] args)
Main method, for test. |
private static String |
makeName(String str,
int start,
int end)
Extracts a name from a given string (path) from the specified start position to the specified end position. |
(package private) static Vector |
parse(String str)
Gets the list of Path from the path string. |
String |
toString()
Get a string representation of this path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final boolean root
private final Vector names
private static final int START
private static final int IN_NAME
private static final int AFTER_NAME
private static final int AFTER_SLASH
Constructor Detail |
---|
Path(boolean root, Vector names)
root
- Flag specifying wether the path starts with / or not.names
- The list of local names.Method Detail |
---|
boolean isRoot()
Vector getNames()
public String toString()
toString
in class Object
static Vector parse(String str) throws Path.ParseException
str
- The path string.
Path.ParseException
- In case of invalid path expression.private static String makeName(String str, int start, int end) throws Path.ParseException
str
- The path string.start
- The start position.end
- The end position.
Path.ParseException
- In case of invalid local name.public static void main(String[] args) throws Path.ParseException
args
- Command line arguments, the first argument is a path.
Path.ParseException
- In case the parsing fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |