类 UrlRegexRequestMatcher

  • 所有已实现的接口:
    WebRequestMatcher

    public final class UrlRegexRequestMatcher
    extends Object
    implements WebRequestMatcher
    A WebRequestMatcher that allows matching on WebRequest#getUrl().toExternalForm() using a regular expression.

    For example, if you would like to match on the domain code.jquery.com, you might want to use the following.

     WebRequestMatcher cdnMatcher = new UrlRegexRequestMatcher(".*?//code.jquery.com/.*");
     
    从以下版本开始:
    4.2
    作者:
    Rob Winch, Sam Brannen
    另请参阅:
    DelegatingWebConnection
    • 方法详细资料

      • matches

        public boolean matches​(com.gargoylesoftware.htmlunit.WebRequest request)
        从接口复制的说明: WebRequestMatcher
        Whether this matcher matches on the supplied web request.
        指定者:
        matches 在接口中 WebRequestMatcher
        参数:
        request - the WebRequest to attempt to match on
        返回:
        true if this matcher matches on the WebRequest