public abstract class PathSpec extends java.lang.Object implements java.lang.Comparable<PathSpec>
Modifier and Type | Field and Description |
---|---|
protected PathSpecGroup |
group |
protected int |
pathDepth |
protected java.lang.String |
pathSpec |
protected java.lang.String |
prefix |
protected int |
specLength |
protected java.lang.String |
suffix |
Constructor and Description |
---|
PathSpec() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PathSpec other) |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getDeclaration()
The as-provided path spec.
|
PathSpecGroup |
getGroup() |
int |
getPathDepth()
Get the number of path elements that this path spec declares.
|
abstract java.lang.String |
getPathInfo(java.lang.String path)
Return the portion of the path that is after the path spec.
|
abstract java.lang.String |
getPathMatch(java.lang.String path)
Return the portion of the path that matches a path spec.
|
java.lang.String |
getPrefix()
A simple prefix match for the pathspec or null
|
abstract java.lang.String |
getRelativePath(java.lang.String base,
java.lang.String path)
Get the relative path.
|
java.lang.String |
getSuffix()
A simple suffix match for the pathspec or null
|
int |
hashCode() |
abstract boolean |
matches(java.lang.String path)
Test to see if the provided path matches this path spec
|
java.lang.String |
toString() |
protected java.lang.String pathSpec
protected PathSpecGroup group
protected int pathDepth
protected int specLength
protected java.lang.String prefix
protected java.lang.String suffix
public int compareTo(PathSpec other)
compareTo
in interface java.lang.Comparable<PathSpec>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public PathSpecGroup getGroup()
public int getPathDepth()
This is used to determine longest match logic.
public abstract java.lang.String getPathInfo(java.lang.String path)
path
- the path to match againstpublic abstract java.lang.String getPathMatch(java.lang.String path)
path
- the path to match againstpublic java.lang.String getDeclaration()
public java.lang.String getPrefix()
public java.lang.String getSuffix()
public abstract java.lang.String getRelativePath(java.lang.String base, java.lang.String path)
base
- the base the path is relative topath
- the additional pathpublic int hashCode()
hashCode
in class java.lang.Object
public abstract boolean matches(java.lang.String path)
path
- the path to testpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1995–2023 Webtide. All rights reserved.