Interface PathMatcher


  • public interface PathMatcher
    URI Path Matcher. It is primary intended for use in Routing implementation.

    Matched URI path is always decoded, normalized and with removed single ended slash (if any).

    Web Server Path Pattern

    While user can implement this interface to implement any specific needs the primary construction method is create(String) factory method. The method accepts Web Server Path Pattern format.
    Web Server path pattern description
    Construct Example Description
    /foo/bar/b,a+z Exact canonical path match. (Including decoded characters.)
    /foo/{var} Named regular expression segment. Name is var and regexp segment is ([^/]+). Use PathMatcher.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)?