public class ServletPathSpec extends AbstractPathSpec
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
_declaration |
private PathSpecGroup |
_group |
private int |
_pathDepth |
private java.lang.String |
_prefix |
private int |
_specLength |
private java.lang.String |
_suffix |
private static Logger |
LOG |
Constructor and Description |
---|
ServletPathSpec(java.lang.String servletPathSpec) |
Modifier and Type | Method and Description |
---|---|
private static void |
assertValidServletPathSpec(java.lang.String servletPathSpec) |
java.lang.String |
getDeclaration()
The as-provided path spec.
|
PathSpecGroup |
getGroup()
The spec group.
|
int |
getPathDepth()
Get the number of path elements that this path spec declares.
|
java.lang.String |
getPathInfo(java.lang.String path)
Return the portion of the path that is after the path spec.
|
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
|
int |
getSpecLength()
The length of the spec.
|
java.lang.String |
getSuffix()
A simple suffix match for the pathspec or null
|
private boolean |
isWildcardMatch(java.lang.String path) |
boolean |
matches(java.lang.String path)
Test to see if the provided path matches this path spec
|
static java.lang.String |
normalize(java.lang.String pathSpec)
If a servlet or filter path mapping isn't a suffix mapping, ensure
it starts with '/'
|
compareTo, equals, hashCode, toString
private static final Logger LOG
private final java.lang.String _declaration
private final PathSpecGroup _group
private final int _pathDepth
private final int _specLength
private final java.lang.String _prefix
private final java.lang.String _suffix
public static java.lang.String normalize(java.lang.String pathSpec)
pathSpec
- the servlet or filter mapping patternprivate static void assertValidServletPathSpec(java.lang.String servletPathSpec)
public int getSpecLength()
PathSpec
public PathSpecGroup getGroup()
PathSpec
public int getPathDepth()
PathSpec
This is used to determine longest match logic.
public java.lang.String getPathInfo(java.lang.String path)
PathSpec
path
- the path to match againstpublic java.lang.String getPathMatch(java.lang.String path)
PathSpec
path
- the path to match againstpublic java.lang.String getDeclaration()
PathSpec
public java.lang.String getPrefix()
PathSpec
public java.lang.String getSuffix()
PathSpec
private boolean isWildcardMatch(java.lang.String path)
public boolean matches(java.lang.String path)
PathSpec
path
- the path to test