Package io.helidon.webserver
Interface PathMatcher
- 
 public interface PathMatcherURI Path Matcher. It is primary intended for use in Routing implementation.Matched URI path is always decoded, normalizedand with removed single ended slash (if any).Web Server Path PatternWhile user can implement this interface to implement any specific needs the primary construction method iscreate(String)factory method. The method accepts Web Server Path Pattern format.Web Server path pattern description Construct Example Description /foo/bar/b,a+zExact canonical path match. (Including decoded characters.) /foo/{var}Named regular expression segment. Name is var and regexp segment is ([^/]+). UsePathMatcher.Result.param(String)method to get value of the segment./foo/{}Nameless regular expression segment. Regexp segment is ([^/]+)/foo/{var:\d+}Named regular expression segment with specified expression. /foo/{:\d+}Nameless regular expression segment with specified expression. /foo/{+var}A convenience shortcut for /foo/{var:.+}./foo/{+}A convenience shortcut for /foo/{:.+}./foo[/bar]A optional section. Translated to regexp: /foo(/bar)?
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static interfacePathMatcher.PrefixResultThe result of prefix matching aPathMatcherto a given URI path.static interfacePathMatcher.ResultThe result of matching aPathMatcherto a given URI path.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static PathMatchercreate(String pathPattern)Creates new instance from provided Web Server path pattern.PathMatcher.Resultmatch(CharSequence path)Matches this matcher against a URI path.PathMatcher.PrefixResultprefixMatch(CharSequence path)Matches this matcher against a left part (prefix) of URI path with granularity on the path segment.
 
- 
- 
- 
Method Detail- 
createstatic PathMatcher create(String pathPattern) throws NullPointerException, IllegalPathPatternException Creates new instance from provided Web Server path pattern. See class level javadoc for the path pattern description.- Parameters:
- pathPattern- Web Server path pattern.
- Returns:
- new instance.
- Throws:
- NullPointerException- if parameter- pathPatternis- null.
- IllegalPathPatternException- if provided pattern is not valid Web Server path pattern.
 
 - 
matchPathMatcher.Result match(CharSequence path) Matches this matcher against a URI path.- Parameters:
- path- resolved and normalized URI path to test against.
- Returns:
- a PathMatcher.Resultof the test.
- Throws:
- NullPointerException- in case that- pathparameter is- null.
 
 - 
prefixMatchPathMatcher.PrefixResult prefixMatch(CharSequence path) Matches this matcher against a left part (prefix) of URI path with granularity on the path segment. It means that accepted 'prefix' cannot break path segment and 'remaining-part' MUST start with slash '/' character.- Parameters:
- path- resolved and normalized URI path to test against.
- Returns:
- a PathMatcher.Resultof the test.
- Throws:
- NullPointerException- in case that- pathparameter is- null.
 
 
- 
 
-