public class AdvancedUrlParser extends java.lang.Object implements UrlParser
比如:
1.
旧 URL 地址为 https://www.github.com/wiki/part, 您在 App 初始化时传入 RetrofitUrlManager.startAdvancedModel(String)
的 BaseUrl 为 https://www.github.com/wiki
您调用 RetrofitUrlManager.putDomain(String, String) 方法传入的 URL 地址是 https://www.google.com/api
经过本解析器解析后生成的新 URL 地址为 http://www.google.com/api/part
2.
旧 URL 地址为 https://www.github.com/wiki/part, 您在 App 初始化时传入 RetrofitUrlManager.startAdvancedModel(String)
的 BaseUrl 为 https://www.github.com/wiki
您调用 RetrofitUrlManager.putDomain(String, String) 方法传入的 URL 地址是 https://www.google.com
经过本解析器解析后生成的新 URL 地址为 http://www.google.com/part
3.
旧 URL 地址为 https://www.github.com/wiki/part, 您在 App 初始化时传入 RetrofitUrlManager.startAdvancedModel(String)
的 BaseUrl 为 https://www.github.com
您调用 RetrofitUrlManager.putDomain(String, String) 方法传入的 URL 地址是 https://www.google.com/api
经过本解析器解析后生成的新 URL 地址为 http://www.google.com/api/wiki/part
解析器会将 BaseUrl 全部替换成您传入的 Url 地址
| Constructor and Description |
|---|
AdvancedUrlParser() |
| Modifier and Type | Method and Description |
|---|---|
void |
init(RetrofitUrlManager retrofitUrlManager)
这里可以做一些初始化操作
|
okhttp3.HttpUrl |
parseUrl(okhttp3.HttpUrl domainUrl,
okhttp3.HttpUrl url)
|
public void init(RetrofitUrlManager retrofitUrlManager)
UrlParserinit in interface UrlParserretrofitUrlManager - RetrofitUrlManager