Class PathPattern
- java.lang.Object
-
- org.glassfish.tyrus.core.uri.internal.PatternWithGroups
-
- org.glassfish.tyrus.core.uri.internal.PathPattern
-
public final class PathPattern extends PatternWithGroups
A path pattern that is a regular expression generated from a URI path template.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, seePathPattern.RightHandPath.capturingZeroSegments
.- Author:
- Paul Sandoz
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PathPattern.RightHandPath
The set of right hand path patterns that may be appended to a path pattern.
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<PathPattern>
COMPARATOR
Path pattern comparator that defers tocomparing 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.-
Fields inherited from class org.glassfish.tyrus.core.uri.internal.PatternWithGroups
EMPTY
-
-
Constructor Summary
Constructors Constructor Description PathPattern(java.lang.String template)
Create a path pattern and post fix withPathPattern.RightHandPath.capturingZeroOrMoreSegments
.PathPattern(java.lang.String template, PathPattern.RightHandPath rhpp)
Create a path pattern and post fix with a right hand path pattern.PathPattern(PathTemplate template)
Create a path pattern and post fix withPathPattern.RightHandPath.capturingZeroOrMoreSegments
.PathPattern(PathTemplate template, PathPattern.RightHandPath rhpp)
Create a path pattern and post fix with a right hand path pattern.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PathPattern
asClosed(PathPattern pattern)
Return a new path pattern with a same path template but aclosed
right hand path.UriTemplate
getTemplate()
-
Methods inherited from class org.glassfish.tyrus.core.uri.internal.PatternWithGroups
equals, getGroupIndexes, getRegex, hashCode, match, match, match, toString
-
-
-
-
Field Detail
-
EMPTY_PATTERN
public static final PathPattern EMPTY_PATTERN
Empty path pattern matching only empty string.
-
END_OF_PATH_PATTERN
public static final PathPattern END_OF_PATH_PATTERN
Path pattern matching the end of a URI path. Can be either empty""
or contain a trailing slash"/"
.
-
OPEN_ROOT_PATH_PATTERN
public static final PathPattern OPEN_ROOT_PATH_PATTERN
Path pattern matching the any URI path.
-
COMPARATOR
public static final java.util.Comparator<PathPattern> COMPARATOR
Path pattern comparator that defers tocomparing the templates
associated with the patterns.
-
-
Constructor Detail
-
PathPattern
public PathPattern(java.lang.String template)
Create a path pattern and post fix withPathPattern.RightHandPath.capturingZeroOrMoreSegments
.- Parameters:
template
- the path template.- See Also:
PathPattern(String, PathPattern.RightHandPath)
-
PathPattern
public PathPattern(PathTemplate template)
Create a path pattern and post fix withPathPattern.RightHandPath.capturingZeroOrMoreSegments
.- Parameters:
template
- the path template- See Also:
PathPattern(PathTemplate, PathPattern.RightHandPath)
-
PathPattern
public PathPattern(java.lang.String template, PathPattern.RightHandPath rhpp)
Create a path pattern and post fix with a right hand path pattern.- Parameters:
template
- the path template.rhpp
- the right hand path pattern postfix.
-
PathPattern
public PathPattern(PathTemplate template, PathPattern.RightHandPath rhpp)
Create a path pattern and post fix with a right hand path pattern.- Parameters:
template
- the path template.rhpp
- the right hand path pattern postfix.
-
-
Method Detail
-
asClosed
public static PathPattern asClosed(PathPattern pattern)
Return a new path pattern with a same path template but aclosed
right hand path.- Parameters:
pattern
- an (open) path pattern to convert to a closed pattern.- Returns:
- closed path pattern for the same path template.
-
getTemplate
public UriTemplate getTemplate()
-
-