类 WebRequestPattensRule

  • 所有已实现的接口:
    WebRequestRule

    public class WebRequestPattensRule
    extends AbstractWebRequestRule<java.lang.String>
    WebRequest Patterns WebRequestRule

    A logical disjunction (' || ') request condition that matches a request against a set of URL path patterns.

    In contrast to PathPatternsRequestCondition which uses parsed PathPatterns, this condition does String pattern matching via AntPathMatcher.

    从以下版本开始:
    1.0.0
    作者:
    Mercy
    另请参阅:
    org.springframework.web.servlet.mvc.condition.PatternsRequestCondition, org.springframework.web.reactive.result.condition.PatternsRequestCondition
    • 构造器概要

      构造器 
      构造器 说明
      WebRequestPattensRule​(java.lang.String... patterns)
      Constructor with URL patterns which are prepended with "/" if necessary.
      WebRequestPattensRule​(java.lang.String[] patterns, boolean useTrailingSlashMatch, org.springframework.util.PathMatcher pathMatcher)
      Variant of WebRequestPattensRule(String...) with a PathMatcher and flag for matching trailing slashes.
      WebRequestPattensRule​(java.lang.String[] patterns, org.springframework.web.util.UrlPathHelper urlPathHelper, org.springframework.util.PathMatcher pathMatcher, boolean useTrailingSlashMatch)
      已过时。
      WebRequestPattensRule​(java.lang.String[] patterns, org.springframework.web.util.UrlPathHelper urlPathHelper, org.springframework.util.PathMatcher pathMatcher, boolean useSuffixPatternMatch, boolean useTrailingSlashMatch)
      Variant of #PatternsRequestCondition(String...) with a UrlPathHelper and a PathMatcher, and flags for matching with suffixes and trailing slashes.
      WebRequestPattensRule​(java.lang.String[] patterns, org.springframework.web.util.UrlPathHelper urlPathHelper, org.springframework.util.PathMatcher pathMatcher, boolean useSuffixPatternMatch, boolean useTrailingSlashMatch, java.util.List<java.lang.String> fileExtensions)
      Variant of WebRequestPattensRule(String...) with a UrlPathHelper and a PathMatcher, and flags for matching with suffixes and trailing slashes, along with specific extensions.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      protected java.util.Collection<java.lang.String> getContent()
      Return the discrete items a request condition is composed of.
      protected java.lang.String getMatchingPattern​(java.lang.String pattern, java.lang.String lookupPath)  
      java.util.List<java.lang.String> getMatchingPatterns​(java.lang.String lookupPath)  
      protected java.lang.String getToStringInfix()
      The notation to use when printing discrete items of content.
      boolean matches​(java.lang.String lookupPath)  
      boolean matches​(org.springframework.web.context.request.NativeWebRequest request)  
      • 从类继承的方法 java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 构造器详细资料

      • WebRequestPattensRule

        public WebRequestPattensRule​(java.lang.String... patterns)
        Constructor with URL patterns which are prepended with "/" if necessary.
        参数:
        patterns - 0 or more URL patterns; no patterns results in an empty path "" mapping which matches all requests.
      • WebRequestPattensRule

        public WebRequestPattensRule​(java.lang.String[] patterns,
                                     boolean useTrailingSlashMatch,
                                     @Nullable
                                     org.springframework.util.PathMatcher pathMatcher)
        Variant of WebRequestPattensRule(String...) with a PathMatcher and flag for matching trailing slashes.
      • WebRequestPattensRule

        @Deprecated
        public WebRequestPattensRule​(java.lang.String[] patterns,
                                     @Nullable
                                     org.springframework.web.util.UrlPathHelper urlPathHelper,
                                     @Nullable
                                     org.springframework.util.PathMatcher pathMatcher,
                                     boolean useTrailingSlashMatch)
        已过时。
        Variant of WebRequestPattensRule(String...) with a UrlPathHelper and a PathMatcher, and whether to match trailing slashes.

        As of 5.3 the path is obtained through the static method UrlPathHelper.getResolvedLookupPath(javax.servlet.ServletRequest) and a UrlPathHelper does not need to be passed in. WebRequestPattensRule(String[], boolean, PathMatcher).

      • WebRequestPattensRule

        public WebRequestPattensRule​(java.lang.String[] patterns,
                                     @Nullable
                                     org.springframework.web.util.UrlPathHelper urlPathHelper,
                                     @Nullable
                                     org.springframework.util.PathMatcher pathMatcher,
                                     boolean useSuffixPatternMatch,
                                     boolean useTrailingSlashMatch)
        Variant of #PatternsRequestCondition(String...) with a UrlPathHelper and a PathMatcher, and flags for matching with suffixes and trailing slashes.

        As of 5.3 the path is obtained through the static method UrlPathHelper.getResolvedLookupPath(javax.servlet.ServletRequest) and a UrlPathHelper does not need to be passed in.

      • WebRequestPattensRule

        public WebRequestPattensRule​(java.lang.String[] patterns,
                                     @Nullable
                                     org.springframework.web.util.UrlPathHelper urlPathHelper,
                                     @Nullable
                                     org.springframework.util.PathMatcher pathMatcher,
                                     boolean useSuffixPatternMatch,
                                     boolean useTrailingSlashMatch,
                                     @Nullable
                                     java.util.List<java.lang.String> fileExtensions)
        Variant of WebRequestPattensRule(String...) with a UrlPathHelper and a PathMatcher, and flags for matching with suffixes and trailing slashes, along with specific extensions.
        参数:
        patterns -
        urlPathHelper -
        pathMatcher -
        useSuffixPatternMatch -
        useTrailingSlashMatch -
        fileExtensions -
    • 方法详细资料

      • getContent

        protected java.util.Collection<java.lang.String> getContent()
        从类复制的说明: AbstractWebRequestRule
        Return the discrete items a request condition is composed of.

        For example URL patterns, HTTP request methods, param expressions, etc.

        指定者:
        getContent 在类中 AbstractWebRequestRule<java.lang.String>
        返回:
        a collection of objects (never null)
      • getToStringInfix

        protected java.lang.String getToStringInfix()
        从类复制的说明: AbstractWebRequestRule
        The notation to use when printing discrete items of content.

        For example " || " for URL patterns or " && " for param expressions.

        指定者:
        getToStringInfix 在类中 AbstractWebRequestRule<java.lang.String>
      • matches

        public boolean matches​(org.springframework.web.context.request.NativeWebRequest request)
      • matches

        public boolean matches​(java.lang.String lookupPath)
      • getMatchingPatterns

        public java.util.List<java.lang.String> getMatchingPatterns​(java.lang.String lookupPath)
      • getMatchingPattern

        @Nullable
        protected java.lang.String getMatchingPattern​(java.lang.String pattern,
                                                      java.lang.String lookupPath)