类 HierarchicalUriComponents
java.lang.Object
cn.taketoday.web.util.UriComponents
cn.taketoday.web.util.HierarchicalUriComponents
- 所有已实现的接口:
Serializable
Extension of
UriComponents for hierarchical URIs.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma, Juergen Hoeller, Rossen Stoyanchev, Phillip Webb, Sam Brannen
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明private static enum(专用程序包) static final classRepresents a path backed by a String.(专用程序包) static interfaceDefines the contract for path (segments).(专用程序包) static final classRepresents a collection of PathComponents.(专用程序包) static final classRepresents a path backed by a String list (i.e. path segments).private static final record(专用程序包) static enumEnumeration used to identify the allowed characters per URI component.private static class从类继承的嵌套类/接口 cn.taketoday.web.util.UriComponents
UriComponents.UriTemplateVariables -
字段概要
字段修饰符和类型字段说明private final HierarchicalUriComponents.EncodeStateprivate final String(专用程序包) static final HierarchicalUriComponents.PathComponentRepresents an empty path.private final HierarchicalUriComponents.PathComponentprivate static final charprivate static final Stringprivate final Stringprivate final Stringprivate UnaryOperator<String> -
构造器概要
构造器限定符构造器说明(专用程序包)HierarchicalUriComponents(String scheme, String fragment, String userInfo, String host, String port, HierarchicalUriComponents.PathComponent path, cn.taketoday.util.MultiValueMap<String, String> query, boolean encoded) Package-private constructor.privateHierarchicalUriComponents(String scheme, String fragment, String userInfo, String host, String port, HierarchicalUriComponents.PathComponent path, cn.taketoday.util.MultiValueMap<String, String> queryParams, HierarchicalUriComponents.EncodeState encodeState, UnaryOperator<String> variableEncoder) -
方法概要
修饰符和类型方法说明protected voidSet all components of the given UriComponentsBuilder.A variant ofUriComponents.encode()with a charset other than "UTF-8".(专用程序包) HierarchicalUriComponentsencodeTemplate(Charset charset) Identical toUriComponents.encode()but skipping over URI variable placeholders.(专用程序包) static StringencodeUriComponent(String source, String encoding, HierarchicalUriComponents.Type type) Encode the given source into an encoded String using the rules specified by the given component and with the given options.(专用程序包) static StringencodeUriComponent(String source, Charset charset, HierarchicalUriComponents.Type type) Encode the given source into an encoded String using the rules specified by the given component and with the given options.booleanprotected HierarchicalUriComponentsexpandInternal(UriComponents.UriTemplateVariables uriVariables) Replace all URI template variables with the values from the givenUriComponents.UriTemplateVariables.getHost()Return the host.private HierarchicalUriComponents.TypegetPath()Return the path.Return the list of path segments.intgetPort()Return the port.getQuery()Return the query.Return the map of query parameters.Return the scheme specific part.Return the user info.inthashCode()Normalize the path removing sequences like "path/..".toUri()Create aURIfrom this instance as follows:Concatenate all URI components to return the fully formed URI String.private voidverify()Check if any of the URI components contain any illegal characters.private static voidverifyUriComponent(String source, HierarchicalUriComponents.Type type) 从类继承的方法 cn.taketoday.web.util.UriComponents
encode, expand, expand, expand, expandUriComponent, expandUriComponent, getFragment, getScheme, toString
-
字段详细资料
-
PATH_DELIMITER
private static final char PATH_DELIMITER- 另请参阅:
-
PATH_DELIMITER_STRING
-
EMPTY_QUERY_PARAMS
-
NULL_PATH_COMPONENT
Represents an empty path. -
userInfo
-
host
-
port
-
path
-
queryParams
-
encodeState
-
variableEncoder
-
-
构造器详细资料
-
HierarchicalUriComponents
HierarchicalUriComponents(@Nullable String scheme, @Nullable String fragment, @Nullable String userInfo, @Nullable String host, @Nullable String port, @Nullable HierarchicalUriComponents.PathComponent path, @Nullable cn.taketoday.util.MultiValueMap<String, String> query, boolean encoded) Package-private constructor. All arguments are optional, and can benull.- 参数:
scheme- the schemeuserInfo- the user infohost- the hostport- the portpath- the pathquery- the query parametersfragment- the fragmentencoded- whether the components are already encoded
-
HierarchicalUriComponents
private HierarchicalUriComponents(@Nullable String scheme, @Nullable String fragment, @Nullable String userInfo, @Nullable String host, @Nullable String port, HierarchicalUriComponents.PathComponent path, cn.taketoday.util.MultiValueMap<String, String> queryParams, HierarchicalUriComponents.EncodeState encodeState, @Nullable UnaryOperator<String> variableEncoder)
-
-
方法详细资料
-
getSchemeSpecificPart
从类复制的说明:UriComponentsReturn the scheme specific part. Can benull.- 指定者:
getSchemeSpecificPart在类中UriComponents
-
getUserInfo
从类复制的说明:UriComponentsReturn the user info. Can benull.- 指定者:
getUserInfo在类中UriComponents
-
getHost
从类复制的说明:UriComponentsReturn the host. Can benull.- 指定者:
getHost在类中UriComponents
-
getPort
public int getPort()从类复制的说明:UriComponentsReturn the port.-1if no port has been set.- 指定者:
getPort在类中UriComponents
-
getPath
从类复制的说明:UriComponentsReturn the path. Can benull.- 指定者:
getPath在类中UriComponents
-
getPathSegments
从类复制的说明:UriComponentsReturn the list of path segments. Empty if no path has been set.- 指定者:
getPathSegments在类中UriComponents
-
getQuery
从类复制的说明:UriComponentsReturn the query. Can benull.- 指定者:
getQuery在类中UriComponents
-
getQueryParams
Return the map of query parameters. Empty if no query has been set.- 指定者:
getQueryParams在类中UriComponents
-
encodeTemplate
Identical toUriComponents.encode()but skipping over URI variable placeholders. AlsovariableEncoderis initialized with the given charset for use later when URI variables are expanded. -
encode
从类复制的说明:UriComponentsA variant ofUriComponents.encode()with a charset other than "UTF-8".- 指定者:
encode在类中UriComponents- 参数:
charset- the charset to use for encoding- 另请参阅:
-
encodeQueryParams
private cn.taketoday.util.MultiValueMap<String,String> encodeQueryParams(BiFunction<String, HierarchicalUriComponents.Type, String> encoder) -
encodeUriComponent
static String encodeUriComponent(String source, String encoding, HierarchicalUriComponents.Type type) Encode the given source into an encoded String using the rules specified by the given component and with the given options.- 参数:
source- the source Stringencoding- the encoding of the source Stringtype- the URI component for the source- 返回:
- the encoded URI
- 抛出:
IllegalArgumentException- when the given value is not a valid URI component
-
encodeUriComponent
static String encodeUriComponent(String source, Charset charset, HierarchicalUriComponents.Type type) Encode the given source into an encoded String using the rules specified by the given component and with the given options.- 参数:
source- the source Stringcharset- the encoding of the source Stringtype- the URI component for the source- 返回:
- the encoded URI
- 抛出:
IllegalArgumentException- when the given value is not a valid URI component
-
getHostType
-
verify
private void verify()Check if any of the URI components contain any illegal characters.- 抛出:
IllegalArgumentException- if any component has illegal characters
-
verifyUriComponent
private static void verifyUriComponent(@Nullable String source, HierarchicalUriComponents.Type type) -
expandInternal
从类复制的说明:UriComponentsReplace all URI template variables with the values from the givenUriComponents.UriTemplateVariables.- 指定者:
expandInternal在类中UriComponents- 参数:
uriVariables- the URI template values- 返回:
- the expanded URI components
-
expandQueryParams
private cn.taketoday.util.MultiValueMap<String,String> expandQueryParams(UriComponents.UriTemplateVariables variables) -
normalize
从类复制的说明:UriComponentsNormalize the path removing sequences like "path/..". Note that normalization is applied to the full path, and not to individual path segments.- 指定者:
normalize在类中UriComponents- 另请参阅:
-
StringUtils.cleanPath(String)
-
toUriString
从类复制的说明:UriComponentsConcatenate all URI components to return the fully formed URI String.This method amounts to simple String concatenation of the current URI component values and as such the result may contain illegal URI characters, for example if URI variables have not been expanded or if encoding has not been applied via
UriComponentsBuilder.encode()orUriComponents.encode().- 指定者:
toUriString在类中UriComponents
-
toUri
从类复制的说明:UriComponentsCreate aURIfrom this instance as follows:If the current instance is
encoded, form the full URI String viaUriComponents.toUriString(), and then pass it to the single argumentURIconstructor which preserves percent encoding.If not yet encoded, pass individual URI component values to the multi-argument
URIconstructor which quotes illegal characters that cannot appear in their respective URI component.- 指定者:
toUri在类中UriComponents
-
copyToUriComponentsBuilder
从类复制的说明:UriComponentsSet all components of the given UriComponentsBuilder.- 指定者:
copyToUriComponentsBuilder在类中UriComponents
-
equals
-
hashCode
public int hashCode()
-