Top Description Inners Fields Constructors Methods
org.springframework.web.util

pack-priv final Class HierarchicalUriComponents

extends UriComponents
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.io.ByteArrayOutputStream, .Serializable, java.net.URI, .URISyntaxException, java.nio.charset.Charset, java.util.ArrayList, .Collections, .List, .Objects, .StringJoiner, java.util.function.BiFunction, .UnaryOperator, org.springframework.lang.NonNull, .Nullable, org.springframework.util.Assert, .CollectionUtils, .LinkedMultiValueMap, .MultiValueMap, .ObjectUtils, .StreamUtils, .StringUtils

Extension of UriComponents for hierarchical URIs.
Authors
Arjen Poutsma, Juergen Hoeller, Rossen Stoyanchev, Phillip Webb, Sam Brannen
Since
3.1.3
See Also
Hierarchical URIs

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
pack-priv static class
HierarchicalUriComponents.FullPathComponent

Represents a path backed by a String.

pack-priv static interface
HierarchicalUriComponents.PathComponent

Defines the contract for path (segments).

pack-priv static class
HierarchicalUriComponents.PathComponentComposite

Represents a collection of PathComponents.

pack-priv static class
HierarchicalUriComponents.PathSegmentComponent

Represents a path backed by a String list (i.e. path segments).

private static class
pack-priv static enum
HierarchicalUriComponents.Type

Enumeration used to identify the allowed characters per URI component.

private static class

Field Summary

Modifier and TypeField and Description
private static final MultiValueMap<String, String>
private final HierarchicalUriComponents.EncodeState
private final String
pack-priv static final HierarchicalUriComponents.PathComponent
NULL_PATH_COMPONENT

Represents an empty path.

private final HierarchicalUriComponents.PathComponent
private static final char
private static final String
private final String
private final MultiValueMap<String, String>
private final String
private UnaryOperator<String>

Constructor Summary

AccessConstructor and Description
pack-priv
HierarchicalUriComponents(String
the scheme
scheme
,
String
the fragment
fragment
,
String
the user info
userInfo
,
String
the host
host
,
String
the port
port
,
HierarchicalUriComponents.PathComponent
the path
path
,
MultiValueMap<String, String>
the query parameters
query
,
boolean
whether the components are already encoded
encoded
)

Package-private constructor.

private

Method Summary

Modifier and TypeMethod and Description
protected void
copyToUriComponentsBuilder(UriComponentsBuilder builder)

Implements abstract org.springframework.web.util.UriComponents.copyToUriComponentsBuilder.

Set all components of the given UriComponentsBuilder.

public HierarchicalUriComponents
encode(Charset
the charset to use for encoding
charset
)

Implements abstract org.springframework.web.util.UriComponents.encode.

A variant of encode() with a charset other than "UTF-8".

private MultiValueMap<String, String>
pack-priv HierarchicalUriComponents
encodeTemplate(Charset charset)

Identical to encode() but skipping over URI variable placeholders.

pack-priv static String

Returns:

the encoded URI
encodeUriComponent
(String
the source String
source
,
String
the encoding of the source String
encoding
,
HierarchicalUriComponents.Type
the URI component for the source
type
)

Encode the given source into an encoded String using the rules specified by the given component and with the given options.

pack-priv static String

Returns:

the encoded URI
encodeUriComponent
(String
the source String
source
,
Charset
the encoding of the source String
charset
,
HierarchicalUriComponents.Type
the URI component for the source
type
)

Encode the given source into an encoded String using the rules specified by the given component and with the given options.

public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

protected HierarchicalUriComponents
expandInternal(UriComponents.UriTemplateVariables
the URI template values
uriVariables
)

Implements abstract org.springframework.web.util.UriComponents.expandInternal.

Replace all URI template variables with the values from the given UriTemplateVariables.

private MultiValueMap<String, String>
public String
getHost()

Implements abstract org.springframework.web.util.UriComponents.getHost.

Return the host.

private HierarchicalUriComponents.Type
public String
getPath()

Implements abstract org.springframework.web.util.UriComponents.getPath.

Return the path.

public List<String>
getPathSegments()

Implements abstract org.springframework.web.util.UriComponents.getPathSegments.

Return the list of path segments.

public int
getPort()

Implements abstract org.springframework.web.util.UriComponents.getPort.

Return the port.

public String
getQuery()

Implements abstract org.springframework.web.util.UriComponents.getQuery.

Return the query.

public MultiValueMap<String, String>
getQueryParams()

Implements abstract org.springframework.web.util.UriComponents.getQueryParams.

Return the map of query parameters.

public String
getSchemeSpecificPart()

Implements abstract org.springframework.web.util.UriComponents.getSchemeSpecificPart.

Return the scheme specific part.

public String
getUserInfo()

Implements abstract org.springframework.web.util.UriComponents.getUserInfo.

Return the user info.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public UriComponents
normalize()

Implements abstract org.springframework.web.util.UriComponents.normalize.

Normalize the path removing sequences like "path/..".

public URI
toUri()

Implements abstract org.springframework.web.util.UriComponents.toUri.

Create a URI from this instance as follows:

If the current instance is encoded, form the full URI String via toUriString(), and then pass it to the single argument URI constructor which preserves percent encoding.

public String
toUriString()

Implements abstract org.springframework.web.util.UriComponents.toUriString.

Concatenate all URI components to return the fully formed URI String.

private void
verify()

Check if any of the URI components contain any illegal characters.

private static void
Inherited from org.springframework.web.util.UriComponents:
encodeexpandexpandexpandexpandUriComponentexpandUriComponentgetFragmentgetSchemetoString