public class PathTemplate extends Object implements Comparable<PathTemplate>
This class can be compared to other path templates, with templates that are considered lower have a higher priority, and should be checked first.
This comparison can also be used to check for semantically equal paths, if a.compareTo(b) == 0 then the two paths are equivalent, which will generally result in a deployment exception.
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PathTemplate o) |
static PathTemplate |
create(String inputPath) |
boolean |
equals(Object o) |
String |
getBase() |
Set<String> |
getParameterNames() |
String |
getTemplateString() |
int |
hashCode() |
boolean |
matches(String path,
Map<String,String> pathParameters)
Check if the given uri matches the template.
|
String |
toString() |
public static PathTemplate create(String inputPath)
public boolean matches(String path, Map<String,String> pathParameters)
Note the map may be modified even if the match in unsuccessful, however in this case it will be emptied before the method returns
path
- The request path, relative to the context rootpathParameters
- The path parameters map to fill outpublic int compareTo(PathTemplate o)
compareTo
in interface Comparable<PathTemplate>
public String getBase()
public String getTemplateString()
Copyright © 2017 JBoss by Red Hat. All rights reserved.