Class PathMatch


  • public class PathMatch
    extends java.lang.Object
    The result of matching a template URI against a real request URI. If there is a match, then any path parameters are available in the params() map.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean fullyMatches()  
      java.util.Map<java.lang.String,​java.lang.String> params()
      Returns a mapping of URI names to path params.
      boolean prefixMatches()  
      java.util.regex.Matcher regexMatcher()  
      java.util.Map<java.lang.String,​javax.ws.rs.core.PathSegment> segments()
      Returns a mapping of URI names to path segments.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • EMPTY_MATCH

        public static final PathMatch EMPTY_MATCH
        An empty match
    • Method Detail

      • prefixMatches

        public boolean prefixMatches()
        Returns:
        Returns true if the beginning of the checked URI matches this pattern. For example if the pattern is /abc then this will return true for /abc and /abc/def etc.
      • fullyMatches

        public boolean fullyMatches()
        Returns:
        Returns true if the checked URI matches this pattern. For example if the pattern is /abc then this will return true for /abc but false for /abc/def etc.
      • params

        public java.util.Map<java.lang.String,​java.lang.String> params()
        Returns a mapping of URI names to path params. For example the template URI is /fruit/{name} then pathMatch.params().get("name") will return orange if the URI was /fruit/orange
        Returns:
        Returns a read-only map of path parameters names to values.
      • segments

        public java.util.Map<java.lang.String,​javax.ws.rs.core.PathSegment> segments()
        Returns a mapping of URI names to path segments. For example the template URI is /fruit/{name} then pathMatch.params().get("name").getPath() will return orange if the URI was /fruit/orange.

        The segments also contain matrix parameter info.

        Returns:
        Returns a read-only map of path parameters names to values.
      • regexMatcher

        public java.util.regex.Matcher regexMatcher()
        Returns:
        Returns the regex Matcher that was used
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object