public final class UrlPathPattern extends Object implements Comparable<UrlPathPattern>
@RestMethod.path()
value.
Handles aspects of matching and precedence ordering.
Constructor and Description |
---|
UrlPathPattern(String patternString)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(UrlPathPattern o)
Comparator for this object.
|
boolean |
equals(Object o) |
String |
getPatternString()
Bean property getter:
|
String[] |
getVars()
Bean property getter:
|
int |
hashCode() |
protected String[] |
match(String path)
Returns a non-
|
String |
toRegEx()
Returns this path pattern as the compiled regular expression.
|
String |
toString() |
public UrlPathPattern(String patternString)
patternString
- The raw pattern string from the @RestMethod.path()
annotation.protected String[] match(String path)
path
- The path to match against.public int compareTo(UrlPathPattern o)
The comparator is designed to order URL pattern from most-specific to least-specific. For example, the following patterns would be ordered as follows:
/foo/bar
/foo/bar/*
/foo/{id}/bar
/foo/{id}/bar/*
/foo/{id}
/foo/{id}/*
/foo
/foo/*
compareTo
in interface Comparable<UrlPathPattern>
public String toRegEx()
Useful for debugging.
public String[] getVars()
public String getPatternString()
Copyright © 2018 Apache. All rights reserved.