类 UrlRegexRequestMatcher
- java.lang.Object
- org.springframework.test.web.servlet.htmlunit.UrlRegexRequestMatcher
- 所有已实现的接口:
WebRequestMatcher
public final class UrlRegexRequestMatcher extends Object implements WebRequestMatcher
AWebRequestMatcher
that allows matching onWebRequest#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
构造器概要
构造器 构造器 说明 UrlRegexRequestMatcher(String regex)
UrlRegexRequestMatcher(Pattern pattern)
构造器详细资料
UrlRegexRequestMatcher
public UrlRegexRequestMatcher(String regex)
UrlRegexRequestMatcher
public UrlRegexRequestMatcher(Pattern pattern)
方法详细资料
matches
public boolean matches(com.gargoylesoftware.htmlunit.WebRequest request)
从接口复制的说明:WebRequestMatcher
Whether this matcher matches on the supplied web request.- 指定者:
matches
在接口中WebRequestMatcher
- 参数:
request
- theWebRequest
to attempt to match on- 返回:
true
if this matcher matches on theWebRequest