注释类型 Address
@Documented
@MethodLifeCycle(AddressLifeCycle.class)
@Retention(RUNTIME)
@Target({METHOD,TYPE})
public @interface Address
主机地址注解
- 从以下版本开始:
- 1.5.2
- 作者:
- gongjun [dt_flys@hotmail.com]
-
可选元素概要
可选元素
-
元素详细资料
-
scheme
String schemeHTTP协议头协议头可以是:
- http
- https
- 返回:
- HTTP协议头
- 默认值:
- ""
-
host
String host主机地址(主机名/ip地址)- 返回:
- 主机地址
- 默认值:
- ""
-
port
String port主机端口号- 返回:
- 主机端口号
- 默认值:
- ""
-
basePath
String basePathURL根路径两种使用方式:
-
1. 短路径
basePath = "/abc" basePath = "/abc/123" -
2. 完整URL
basePath = "http://localhost:8080/abc" basePath = "http://localhost:8080/abc/123"
在使用完整URL时候会覆盖原有的 schema, host, 以及 port 属性
但若在本注解中设置以上三个属性,则它们的优先级高于 basePath 属性
- 返回:
- URL根路径
- 默认值:
- ""
-
-
source
Class<? extends AddressSource> source动态构建主机地址信息的回调函数接口类- 返回:
- 回调函数接口类
- 默认值:
- com.dtflys.forest.callback.AddressSource.class
-