public class DocumentPath extends Object implements Comparable<DocumentPath>
DocumentTree.| Constructor and Description |
|---|
DocumentPath(String nodeName,
DocumentPath parentPath)
Constructs a new document path.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(DocumentPath that) |
boolean |
equals(Object obj) |
static DocumentPath |
from(String path)
Creates a new
DocumentPath from a period delimited path string. |
int |
hashCode() |
DocumentPath |
parent()
Returns a path for the parent of this node.
|
List<String> |
pathElements()
Returns the list of path elements representing this path in correct
order.
|
String |
toString() |
public DocumentPath(String nodeName, DocumentPath parentPath)
New paths must contain at least one name and string names may NOT contain any period characters.
If one field is null that field will be ignored.
nodeName - the name of the last level of this pathparentPath - the path representing the parent leading up to this
node, in the case of the root this should be nullIllegalDocumentNameException - if both parameters are null or name contains an illegal character ('.')public static DocumentPath from(String path)
DocumentPath from a period delimited path string.path - path stringDocumentPath instancepublic DocumentPath parent()
null.public List<String> pathElements()
public int compareTo(DocumentPath that)
compareTo in interface Comparable<DocumentPath>