类 DefaultUriBuilderFactory.DefaultUriBuilder
- 所有已实现的接口:
UriBuilder
DefaultUriBuilderFactory specific implementation of UriBuilder.-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Build aURIinstance and replaces URI template variables with the values from an array.Build aURIinstance and replaces URI template variables with the values from a map.private URIcreateUri(UriComponents uric) Set the URI fragment.Set the URI host which may contain URI template variables, and may also benullto clear the host of this builder.private UriComponentsBuilderinitUriComponentsBuilder(String uriTemplate) private voidAppend to the path of this builder.pathSegment(String... pathSegments) Append to the path using path segments.port(int port) Set the URI port.Set the URI port .Parse the given query string into query parameters where parameters are separated with'&'and their values, if any, with'='.queryParam(String name, Object... values) Append the given query parameter.queryParam(String name, Collection<?> values) Variant ofUriBuilder.queryParam(String, Object...)with a Collection.queryParamIfPresent(String name, Optional<?> value) Delegates to eitherUriBuilder.queryParam(String, Object...)orUriBuilder.queryParam(String, Collection)if the givenOptionalhas a value, or else if it is empty, no query parameter is added at all.queryParams(cn.taketoday.util.MultiValueMap<String, String> params) Add multiple query parameters and values.replacePath(String path) Override the current path.replaceQuery(String query) Clear existing query parameters and then delegate toUriBuilder.query(String).replaceQueryParam(String name, Object... values) Set the query parameter values replacing existing values, or if no values are given, the query parameter is removed.replaceQueryParam(String name, Collection<?> values) Variant ofUriBuilder.replaceQueryParam(String, Object...)with a Collection.replaceQueryParams(cn.taketoday.util.MultiValueMap<String, String> params) Set the query parameter values after removing all existing ones.Set the URI scheme which may contain URI template variables, and may also benullto clear the scheme of this builder.Set the URI user info which may contain URI template variables, and may also benullto clear the user info of this builder.
-
字段详细资料
-
uriComponentsBuilder
-
-
构造器详细资料
-
DefaultUriBuilder
-
-
方法详细资料
-
initUriComponentsBuilder
-
parsePathIfNecessary
-
scheme
从接口复制的说明:UriBuilderSet the URI scheme which may contain URI template variables, and may also benullto clear the scheme of this builder.- 指定者:
scheme在接口中UriBuilder- 参数:
scheme- the URI scheme
-
userInfo
从接口复制的说明:UriBuilderSet the URI user info which may contain URI template variables, and may also benullto clear the user info of this builder.- 指定者:
userInfo在接口中UriBuilder- 参数:
userInfo- the URI user info
-
host
从接口复制的说明:UriBuilderSet the URI host which may contain URI template variables, and may also benullto clear the host of this builder.- 指定者:
host在接口中UriBuilder- 参数:
host- the URI host
-
port
从接口复制的说明:UriBuilderSet the URI port. Passing-1will clear the port of this builder.- 指定者:
port在接口中UriBuilder- 参数:
port- the URI port
-
port
从接口复制的说明:UriBuilderSet the URI port . Use this method only when the port needs to be parameterized with a URI variable. Otherwise useUriBuilder.port(int). Passingnullwill clear the port of this builder.- 指定者:
port在接口中UriBuilder- 参数:
port- the URI port
-
path
从接口复制的说明:UriBuilderAppend to the path of this builder.The given value is appended as-is to previous
pathvalues without inserting any additional slashes. For example:builder.path("/first-").path("value/").path("/{id}").build("123") // Results is "/first-value/123"By contrast
pathSegmentdoes insert slashes between individual path segments. For example:builder.pathSegment("first-value", "second-value").path("/") // Results is "/first-value/second-value/"The resulting full path is normalized to eliminate duplicate slashes.
Note: When inserting a URI variable value that contains slashes in a
path, whether those are encoded depends on the configured encoding mode. For more details, seeUriComponentsBuilder.encode(), or otherwise if building URIs indirectly viaWebClientorRestTemplate, see itsencodingMode. Also see the URI Encoding section of the reference docs.- 指定者:
path在接口中UriBuilder- 参数:
path- the URI path
-
replacePath
从接口复制的说明:UriBuilderOverride the current path.- 指定者:
replacePath在接口中UriBuilder- 参数:
path- the URI path, ornullfor an empty path
-
pathSegment
从接口复制的说明:UriBuilderAppend to the path using path segments. For example:builder.pathSegment("first-value", "second-value", "{id}").build("123") // Results is "/first-value/second-value/123"If slashes are present in a path segment, they are encoded:
builder.pathSegment("ba/z", "{id}").build("a/b") // Results is "/ba%2Fz/a%2Fb"To insert a trailing slash, use theUriBuilder.path(java.lang.String)builder method:builder.pathSegment("first-value", "second-value").path("/") // Results is "/first-value/second-value/"Empty path segments are ignored and therefore duplicate slashes do not appear in the resulting full path.
- 指定者:
pathSegment在接口中UriBuilder- 参数:
pathSegments- the URI path segments
-
query
从接口复制的说明:UriBuilderParse the given query string into query parameters where parameters are separated with'&'and their values, if any, with'='. The query may contain URI template variables.Note: please, review the Javadoc of
UriBuilder.queryParam(String, Object...)for further notes on the treatment and encoding of individual query parameters.- 指定者:
query在接口中UriBuilder- 参数:
query- the query string
-
replaceQuery
从接口复制的说明:UriBuilderClear existing query parameters and then delegate toUriBuilder.query(String).Note: please, review the Javadoc of
UriBuilder.queryParam(String, Object...)for further notes on the treatment and encoding of individual query parameters.- 指定者:
replaceQuery在接口中UriBuilder- 参数:
query- the query string; anullvalue removes all query parameters.
-
queryParam
从接口复制的说明:UriBuilderAppend the given query parameter. Both the parameter name and values may contain URI template variables to be expanded later from values. If no values are given, the resulting URI will contain the query parameter name only, e.g."?foo"instead of"?foo=bar".Note: encoding, if applied, will only encode characters that are illegal in a query parameter name or value such as
"="or"&". All others that are legal as per syntax rules in RFC 3986 are not encoded. This includes"+"which sometimes needs to be encoded to avoid its interpretation as an encoded space. Stricter encoding may be applied by using a URI template variable along with stricter encoding on variable values. For more details please read the "URI Encoding" section of the Framework reference.- 指定者:
queryParam在接口中UriBuilder- 参数:
name- the query parameter namevalues- the query parameter values- 另请参阅:
-
queryParam
public DefaultUriBuilderFactory.DefaultUriBuilder queryParam(String name, @Nullable Collection<?> values) 从接口复制的说明:UriBuilderVariant ofUriBuilder.queryParam(String, Object...)with a Collection.Note: please, review the Javadoc of
UriBuilder.queryParam(String, Object...)for further notes on the treatment and encoding of individual query parameters.- 指定者:
queryParam在接口中UriBuilder- 参数:
name- the query parameter namevalues- the query parameter values- 另请参阅:
-
queryParamIfPresent
public DefaultUriBuilderFactory.DefaultUriBuilder queryParamIfPresent(String name, Optional<?> value) 从接口复制的说明:UriBuilderDelegates to eitherUriBuilder.queryParam(String, Object...)orUriBuilder.queryParam(String, Collection)if the givenOptionalhas a value, or else if it is empty, no query parameter is added at all.- 指定者:
queryParamIfPresent在接口中UriBuilder- 参数:
name- the query parameter namevalue- an Optional, either empty or holding the query parameter value.
-
queryParams
public DefaultUriBuilderFactory.DefaultUriBuilder queryParams(cn.taketoday.util.MultiValueMap<String, String> params) 从接口复制的说明:UriBuilderAdd multiple query parameters and values.Note: please, review the Javadoc of
UriBuilder.queryParam(String, Object...)for further notes on the treatment and encoding of individual query parameters.- 指定者:
queryParams在接口中UriBuilder- 参数:
params- the params
-
replaceQueryParam
从接口复制的说明:UriBuilderSet the query parameter values replacing existing values, or if no values are given, the query parameter is removed.Note: please, review the Javadoc of
UriBuilder.queryParam(String, Object...)for further notes on the treatment and encoding of individual query parameters.- 指定者:
replaceQueryParam在接口中UriBuilder- 参数:
name- the query parameter namevalues- the query parameter values- 另请参阅:
-
replaceQueryParam
public DefaultUriBuilderFactory.DefaultUriBuilder replaceQueryParam(String name, @Nullable Collection<?> values) 从接口复制的说明:UriBuilderVariant ofUriBuilder.replaceQueryParam(String, Object...)with a Collection.Note: please, review the Javadoc of
UriBuilder.queryParam(String, Object...)for further notes on the treatment and encoding of individual query parameters.- 指定者:
replaceQueryParam在接口中UriBuilder- 参数:
name- the query parameter namevalues- the query parameter values- 另请参阅:
-
replaceQueryParams
public DefaultUriBuilderFactory.DefaultUriBuilder replaceQueryParams(cn.taketoday.util.MultiValueMap<String, String> params) 从接口复制的说明:UriBuilderSet the query parameter values after removing all existing ones.Note: please, review the Javadoc of
UriBuilder.queryParam(String, Object...)for further notes on the treatment and encoding of individual query parameters.- 指定者:
replaceQueryParams在接口中UriBuilder- 参数:
params- the query parameter name
-
fragment
从接口复制的说明:UriBuilderSet the URI fragment. The given fragment may contain URI template variables, and may also benullto clear the fragment of this builder.- 指定者:
fragment在接口中UriBuilder- 参数:
fragment- the URI fragment
-
build
从接口复制的说明:UriBuilderBuild aURIinstance and replaces URI template variables with the values from a map.- 指定者:
build在接口中UriBuilder- 参数:
uriVars- the map of URI variables- 返回:
- the URI
-
build
从接口复制的说明:UriBuilderBuild aURIinstance and replaces URI template variables with the values from an array.- 指定者:
build在接口中UriBuilder- 参数:
uriVars- the map of URI variables- 返回:
- the URI
-
createUri
-