Class UriPatternType.ServletStyleUriPatternMatcher

  • All Implemented Interfaces:
    UriPatternMatcher
    Enclosing class:
    UriPatternType

    private static class UriPatternType.ServletStyleUriPatternMatcher
    extends java.lang.Object
    implements UriPatternMatcher
    Matches URIs using the pattern grammar of the Servlet API and web.xml.
    • Constructor Detail

      • ServletStyleUriPatternMatcher

        public ServletStyleUriPatternMatcher​(java.lang.String pattern)
    • Method Detail

      • matches

        public boolean matches​(java.lang.String uri)
        Specified by:
        matches in interface UriPatternMatcher
        Parameters:
        uri - A "contextual" (i.e. relative) and "normalized" Request URI, *not* a complete one.
        Returns:
        Returns true if the uri matches the pattern.
      • extractPath

        public java.lang.String extractPath​(java.lang.String path)
        Specified by:
        extractPath in interface UriPatternMatcher
        Parameters:
        path - The Path that this service pattern can match against.
        Returns:
        Returns a canonical servlet path from this pattern. For instance, if the pattern is /home/* then the path extracted will be /home. Each pattern matcher implementation must decide and publish what a canonical path represents.

        NOTE(dhanji): This method returns null for the regex pattern matcher.