public class UriTemplatePathSpec extends AbstractPathSpec
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
_declaration |
private PathSpecGroup |
_group |
private java.lang.String |
_logicalDeclaration
The logical (simplified) declaration
|
private int |
_pathDepth |
private java.util.regex.Pattern |
_pattern |
private int |
_specLength |
private java.lang.String[] |
_variables |
private static java.util.Set<java.lang.String> |
FORBIDDEN_SEGMENTS |
private static Logger |
LOG |
private static java.util.regex.Pattern |
VARIABLE_PATTERN |
private static java.lang.String |
VARIABLE_RESERVED
Reserved Symbols in URI Template variable
|
private static java.lang.String |
VARIABLE_SYMBOLS
Allowed Symbols in a URI Template variable
|
Constructor and Description |
---|
UriTemplatePathSpec(java.lang.String rawSpec) |
Modifier and Type | Method and Description |
---|---|
private static void |
assertIsValidVariableLiteral(java.lang.String variable,
java.lang.String declaration)
Validate variable literal name, per RFC6570, Section 2.1 Literals
|
int |
compareTo(PathSpec other) |
java.lang.String |
getDeclaration()
The as-provided path spec.
|
PathSpecGroup |
getGroup()
The spec group.
|
protected java.util.regex.Matcher |
getMatcher(java.lang.String path) |
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.util.Map<java.lang.String,java.lang.String> |
getPathParams(java.lang.String path) |
java.util.regex.Pattern |
getPattern() |
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
|
int |
getVariableCount() |
java.lang.String[] |
getVariables() |
private static boolean |
isValidBasicLiteralCodepoint(int codepoint,
java.lang.String declaration) |
boolean |
matches(java.lang.String path)
Test to see if the provided path matches this path spec
|
equals, hashCode, toString
private static final Logger LOG
private static final java.util.regex.Pattern VARIABLE_PATTERN
private static final java.lang.String VARIABLE_RESERVED
private static final java.lang.String VARIABLE_SYMBOLS
private static final java.util.Set<java.lang.String> FORBIDDEN_SEGMENTS
private final java.lang.String _declaration
private final PathSpecGroup _group
private final int _pathDepth
private final int _specLength
private final java.util.regex.Pattern _pattern
private final java.lang.String[] _variables
private final java.lang.String _logicalDeclaration
private static void assertIsValidVariableLiteral(java.lang.String variable, java.lang.String declaration)
private static boolean isValidBasicLiteralCodepoint(int codepoint, java.lang.String declaration)
public int compareTo(PathSpec other)
compareTo
in interface java.lang.Comparable<PathSpec>
compareTo
in class AbstractPathSpec
public java.util.Map<java.lang.String,java.lang.String> getPathParams(java.lang.String path)
protected java.util.regex.Matcher getMatcher(java.lang.String path)
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
public java.util.regex.Pattern getPattern()
public boolean matches(java.lang.String path)
PathSpec
path
- the path to testpublic int getVariableCount()
public java.lang.String[] getVariables()