public class PatternMatcher extends Object
URLPattern.| Constructor and Description |
|---|
PatternMatcher(String pattern,
boolean full,
boolean allowEmpty)
Constructs a new pattern matcher.
|
| Modifier and Type | Method and Description |
|---|---|
float |
computeDefaultPriority()
Returns the default priority of this pattern.
|
List<String> |
getParameters() |
String |
getPattern()
Returns the pattern of this pattern matcher.
|
String |
makeURL(Map<String,String[]> argmap,
boolean full)
Builds a string that matches this pattern, using the given arguments.
|
boolean |
match(String string,
Map<String,String> params)
Checks whether the given string matches the pattern.
|
int |
matchPrefix(String string,
Map<String,String> params)
Checks whether a prefix of the given string matches the pattern.
|
public PatternMatcher(String pattern, boolean full, boolean allowEmpty) throws IllegalArgumentException
pattern - pattern stringfull - if false, forbid * and **IllegalArgumentException - if the pattern has syntax errorspublic float computeDefaultPriority()
public String getPattern()
public String makeURL(Map<String,String[]> argmap, boolean full)
argmap - map from argument names to valuesfull - if true, add arguments that are not used in the pattern as a querystringpublic boolean match(String string, Map<String,String> params)
string - stringparams - if non-null, parameters are collected in this name-value mappublic int matchPrefix(String string, Map<String,String> params)
string - stringparams - if non-null, parameters are collected in this name-value mapCopyright © 2008-2012 Anders Møller & Mathias Schwarz.