public final class PathPattern extends PatternWithGroups
The path pattern is normalized by removing a terminating "/" if present.
The path pattern is post-fixed with a right hand pattern that consists of either
a matching group that matches zero or more path segments,
see PathPattern.RightHandPath.capturingZeroOrMoreSegments
, or zero path
segments, see PathPattern.RightHandPath.capturingZeroSegments
.
Modifier and Type | Class and Description |
---|---|
static class |
PathPattern.RightHandPath
The set of right hand path patterns that may be appended to a path
pattern.
|
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<PathPattern> |
COMPARATOR
Path pattern comparator that defers to
comparing
the templates associated with the patterns. |
static PathPattern |
EMPTY_PATTERN
Empty path pattern matching only empty string.
|
static PathPattern |
END_OF_PATH_PATTERN
Path pattern matching the end of a URI path.
|
static PathPattern |
OPEN_ROOT_PATH_PATTERN
Path pattern matching the any URI path.
|
private UriTemplate |
template |
EMPTY
Modifier | Constructor and Description |
---|---|
private |
PathPattern() |
|
PathPattern(PathTemplate template)
Create a path pattern and post fix with
PathPattern.RightHandPath.capturingZeroOrMoreSegments . |
|
PathPattern(PathTemplate template,
PathPattern.RightHandPath rhpp)
Create a path pattern and post fix with a right hand path pattern.
|
|
PathPattern(java.lang.String template)
Create a path pattern and post fix with
PathPattern.RightHandPath.capturingZeroOrMoreSegments . |
|
PathPattern(java.lang.String template,
PathPattern.RightHandPath rhpp)
Create a path pattern and post fix with a right hand path pattern.
|
Modifier and Type | Method and Description |
---|---|
private static int[] |
addIndexForRightHandPathCapturingGroup(int numberOfGroups,
int[] indexes) |
static PathPattern |
asClosed(PathPattern pattern)
Return a new path pattern with a same path template but
a
closed right hand path. |
UriTemplate |
getTemplate() |
private static java.lang.String |
postfixWithCapturingGroup(java.lang.String regex) |
private static java.lang.String |
postfixWithCapturingGroup(java.lang.String regex,
PathPattern.RightHandPath rhpp) |
equals, getGroupIndexes, getRegex, hashCode, match, match, match, toString
public static final PathPattern EMPTY_PATTERN
public static final PathPattern END_OF_PATH_PATTERN
""
or contain a trailing slash "/"
.public static final PathPattern OPEN_ROOT_PATH_PATTERN
public static final java.util.Comparator<PathPattern> COMPARATOR
comparing
the templates
associated with the patterns.private final UriTemplate template
private PathPattern()
public PathPattern(java.lang.String template)
PathPattern.RightHandPath.capturingZeroOrMoreSegments
.template
- the path template.PathPattern(String, PathPattern.RightHandPath)
public PathPattern(PathTemplate template)
PathPattern.RightHandPath.capturingZeroOrMoreSegments
.template
- the path templatePathPattern(PathTemplate, PathPattern.RightHandPath)
public PathPattern(java.lang.String template, PathPattern.RightHandPath rhpp)
template
- the path template.rhpp
- the right hand path pattern postfix.public PathPattern(PathTemplate template, PathPattern.RightHandPath rhpp)
template
- the path template.rhpp
- the right hand path pattern postfix.public static PathPattern asClosed(PathPattern pattern)
closed
right hand path.pattern
- an (open) path pattern to convert to a closed pattern.public UriTemplate getTemplate()
private static java.lang.String postfixWithCapturingGroup(java.lang.String regex)
private static java.lang.String postfixWithCapturingGroup(java.lang.String regex, PathPattern.RightHandPath rhpp)
private static int[] addIndexForRightHandPathCapturingGroup(int numberOfGroups, int[] indexes)