java.net.URI , but with more powerful encoding options and support for
URI template variables.
UriComponentsBuilder
| Modifier and Type | Class and Description |
|---|---|
| private static class | UriComponents.MapTemplateVariables
URI template variables backed by a map. |
| public static interface | UriComponents.UriTemplateVariables
Defines the contract for URI Template variables. |
| private static class | UriComponents.VarArgsTemplateVariables
URI template variables backed by a variable argument array. |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private static final Pattern | NAMES_PATTERN
Captures URI template variable names. |
| private final String |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract void | copyToUriComponentsBuilder(UriComponentsBuilder builder)
Set all components of the given UriComponentsBuilder. |
| public final UriComponents | |
| public abstract UriComponents | |
| public final UriComponents | |
| public final UriComponents | |
| public final UriComponents | Returns: the expanded URI componentsthe URI template values uriVariablesReplace all URI template variables with the values from the given
|
| pack-priv abstract UriComponents | Returns: the expanded URI componentsthe URI template values uriVariablesReplace all URI template variables with the values from the given |
| pack-priv static String | |
| pack-priv static String | expandUriComponent(String source, UriComponents.
|
| public final String | |
| public abstract String | |
| public abstract String | |
| public abstract List | |
| public abstract int | |
| public abstract String | |
| public abstract MultiValueMap | |
| public final String | |
| public abstract String | |
| public abstract String | |
| private static String | |
| private static String | |
| public abstract UriComponents | |
| private static String | |
| public final String | |
| public abstract URI | toUri()
Create a If the current instance is |
| public abstract String |
| fragment | back to summary |
|---|---|
| private final String fragment
| |
| NAMES_PATTERN | back to summary |
|---|---|
| private static final Pattern NAMES_PATTERN Captures URI template variable names. | |
| scheme | back to summary |
|---|---|
| private final String scheme
| |
| UriComponents | back to summary |
|---|---|
| protected UriComponents(String scheme, String fragment) | |
| copyToUriComponentsBuilder | back to summary |
|---|---|
| protected abstract void copyToUriComponentsBuilder(UriComponentsBuilder builder) Set all components of the given UriComponentsBuilder.
| |
| encode | back to summary |
|---|---|
| public final UriComponents encode() Invoke this after expanding URI variables to encode the resulting URI component values. In comparison to
| |
| encode | back to summary |
|---|---|
| public abstract UriComponents encode(Charset charset) A variant of
| |
| expand | back to summary |
|---|---|
| public final UriComponents expand(Map<String, ?> uriVariables) Replace all URI template variables with the values from a given map. The given map keys represent variable names; the corresponding values represent variable values. The order of variables is not significant.
| |
| expand | back to summary |
|---|---|
| public final UriComponents expand(Object... uriVariableValues) Replace all URI template variables with the values from a given array. The given array represents variable values. The order of variables is significant.
| |
| expand | back to summary |
|---|---|
| public final UriComponents expand(UriComponents. Replace all URI template variables with the values from the given
| |
| expandInternal | back to summary |
|---|---|
| pack-priv abstract UriComponents expandInternal(UriComponents. Replace all URI template variables with the values from the given
| |
| expandUriComponent | back to summary |
|---|---|
pack-priv static String expandUriComponent(String source, UriComponents.
| |
| expandUriComponent | back to summary |
|---|---|
pack-priv static String expandUriComponent(String source, UriComponents.
| |
| getFragment | back to summary |
|---|---|
| public final String getFragment() Return the fragment. Can be
| |
| getHost | back to summary |
|---|---|
| public abstract String getHost() Return the host. Can be
| |
| getPath | back to summary |
|---|---|
| public abstract String getPath() Return the path. Can be
| |
| getPathSegments | back to summary |
|---|---|
| public abstract List Return the list of path segments. Empty if no path has been set. | |
| getPort | back to summary |
|---|---|
| public abstract int getPort() Return the port. | |
| getQuery | back to summary |
|---|---|
| public abstract String getQuery() Return the query. Can be
| |
| getQueryParams | back to summary |
|---|---|
| public abstract MultiValueMap Return the map of query parameters. Empty if no query has been set. | |
| getScheme | back to summary |
|---|---|
| public final String getScheme() Return the scheme. Can be
| |
| getSchemeSpecificPart | back to summary |
|---|---|
| public abstract String getSchemeSpecificPart() Return the scheme specific part. Can be
| |
| getUserInfo | back to summary |
|---|---|
| public abstract String getUserInfo() Return the user info. Can be
| |
| getVariableName | back to summary |
|---|---|
| private static String getVariableName(String match) | |
| getVariableValueAsString | back to summary |
|---|---|
| private static String getVariableValueAsString(Object variableValue) | |
| normalize | back to summary |
|---|---|
| public abstract UriComponents normalize() Normalize the path removing sequences like "path/..". Note that normalization is applied to the full path, and not to individual path segments. | |
| sanitizeSource | back to summary |
|---|---|
| private static String sanitizeSource(String source) Remove nested "{}" such as in URI vars with regular expressions. | |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. A simple pass-through to
| |
| toUri | back to summary |
|---|---|
| public abstract URI toUri() Create a If the current instance is If not yet encoded, pass individual URI component values to the
multi-argument | |
| toUriString | back to summary |
|---|---|
| public abstract String toUriString() Concatenate 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 | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | getValue(String
the variable name name)Implements org. |
| uriVariables | back to summary |
|---|---|
| private final Map<String, ?> uriVariables | |
| MapTemplateVariables | back to summary |
|---|---|
| public MapTemplateVariables(Map<String, ?> uriVariables) | |
| getValue | back to summary |
|---|---|
| public Object getValue(String name) Implements org. Doc from org. Get the value for the given URI variable name.
If the value is
| |
HierarchicalUriComponents#expand
| Modifier and Type | Field and Description |
|---|---|
| public static final Object | SKIP_VALUE
Constant for a value that indicates a URI variable name should be ignored and left as is. |
| Modifier and Type | Method and Description |
|---|---|
| public Object |
| SKIP_VALUE | back to summary |
|---|---|
| public static final Object SKIP_VALUE Constant for a value that indicates a URI variable name should be ignored and left as is. This is useful for partial expanding of some but not all URI variables. | |
| getValue | back to summary |
|---|---|
| public Object getValue(String name) Get the value for the given URI variable name.
If the value is
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | getValue(String
the variable name name)Implements org. |
| valueIterator | back to summary |
|---|---|
| private final Iterator<Object> valueIterator | |
| VarArgsTemplateVariables | back to summary |
|---|---|
| public VarArgsTemplateVariables(Object... uriVariableValues) | |
| getValue | back to summary |
|---|---|
| public Object getValue(String name) Implements org. Doc from org. Get the value for the given URI variable name.
If the value is
| |