Class UriPatternType.RegexUriPatternMatcher

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String originalPattern  
      private java.util.regex.Pattern pattern  
    • Constructor Summary

      Constructors 
      Constructor Description
      RegexUriPatternMatcher​(java.lang.String pattern)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String extractPath​(java.lang.String path)  
      java.lang.String getOriginalPattern()
      Returns the original pattern that was registered.
      UriPatternType getPatternType()
      Returns the type of pattern this is.
      boolean matches​(java.lang.String uri)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pattern

        private final java.util.regex.Pattern pattern
      • originalPattern

        private final java.lang.String originalPattern
    • Constructor Detail

      • RegexUriPatternMatcher

        public RegexUriPatternMatcher​(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.