@BeanIgnore 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.
|
String[] |
getVars()
Returns the variable names found in the pattern.
|
boolean |
hasVars()
Returns
|
UrlPathPatternMatch |
match(String path)
Returns a non-
|
UrlPathPatternMatch |
match(UrlPathInfo pathInfo)
Returns a non-
|
String |
toString() |
public UrlPathPattern(String patternString)
patternString
- The raw pattern string from the @RestMethod(path)
annotation.public UrlPathPatternMatch match(String path)
path
- The path to match against.public UrlPathPatternMatch match(UrlPathInfo pathInfo)
pathInfo
- The path to match against.public String[] getVars()
public boolean hasVars()
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:
compareTo
in interface Comparable<UrlPathPattern>
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.