public final class DelegatingWebConnection extends ObjectSE implements com.gargoylesoftware.htmlunit.WebConnection
WebConnection 実装への委譲を可能にする WebConnection の実装。 例: ドメイン code.jquery.com で JavaScript をホストしている場合、以下を使用できます。
WebClient webClient = new WebClient();
MockMvc mockMvc = ...
MockMvcWebConnection mockConnection = new MockMvcWebConnection(mockMvc, webClient);
WebRequestMatcher cdnMatcher = new UrlRegexRequestMatcher(".*?//code.jquery.com/.*");
WebConnection httpConnection = new HttpWebConnection(webClient);
WebConnection webConnection = new DelegatingWebConnection(mockConnection, new DelegateWebConnection(cdnMatcher, httpConnection));
webClient.setWebConnection(webConnection);
WebClient webClient = new WebClient();
webClient.setWebConnection(webConnection);
| 修飾子と型 | クラスと説明 |
|---|---|
static class | DelegatingWebConnection.DelegateWebConnection デリゲート Web 接続。 |
| コンストラクターと説明 |
|---|
DelegatingWebConnection(com.gargoylesoftware.htmlunit.WebConnection defaultConnection, DelegatingWebConnection.DelegateWebConnection... connections) |
DelegatingWebConnection(com.gargoylesoftware.htmlunit.WebConnection defaultConnection, ListSE<DelegatingWebConnection.DelegateWebConnection> connections) |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | close() |
com.gargoylesoftware.htmlunit.WebResponse | getResponse(com.gargoylesoftware.htmlunit.WebRequest request) |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic DelegatingWebConnection(com.gargoylesoftware.htmlunit.WebConnection defaultConnection,
ListSE<DelegatingWebConnection.DelegateWebConnection> connections)public DelegatingWebConnection(com.gargoylesoftware.htmlunit.WebConnection defaultConnection,
DelegatingWebConnection.DelegateWebConnection... connections)public com.gargoylesoftware.htmlunit.WebResponse getResponse(com.gargoylesoftware.htmlunit.WebRequest request)
throws IOExceptionSEcom.gargoylesoftware.htmlunit.WebConnection の getResponse IOExceptionSEpublic void close()
com.gargoylesoftware.htmlunit.WebConnection の close AutoCloseableSE の closeSE