public abstract class AbstractUriTemplateHandler extends Object implements UriTemplateHandler
UriTemplateHandler implementations.
Support setBaseUrl(java.lang.String) and setDefaultUriVariables(java.util.Map<java.lang.String, ?>) properties
that should be relevant regardless of the URI template expand and encode
mechanism used in sub-classes.
| Constructor and Description |
|---|
AbstractUriTemplateHandler() |
| Modifier and Type | Method and Description |
|---|---|
URI |
expand(String uriTemplate,
Map<String,?> uriVariables)
Expand the given URI template from a map of URI variables.
|
URI |
expand(String uriTemplate,
Object... uriVariables)
Expand the given URI template from an array of URI variables.
|
protected abstract URI |
expandInternal(String uriTemplate,
Map<String,?> uriVariables)
Actually expand and encode the URI template.
|
protected abstract URI |
expandInternal(String uriTemplate,
Object... uriVariables)
Actually expand and encode the URI template.
|
String |
getBaseUrl()
Return the configured base URL.
|
Map<String,?> |
getDefaultUriVariables()
Return a read-only copy of the configured default URI variables.
|
void |
setBaseUrl(String baseUrl)
Configure a base URL to prepend URI templates with.
|
void |
setDefaultUriVariables(Map<String,?> defaultUriVariables)
Configure default URI variable values to use with every expanded URI
template.
|
public void setBaseUrl(String baseUrl)
UriComponentsBuilder.baseUrl - the base URL.public String getBaseUrl()
public void setDefaultUriVariables(Map<String,?> defaultUriVariables)
expand(String, Map)
can override the default values.defaultUriVariables - the default URI variable valuespublic Map<String,?> getDefaultUriVariables()
public URI expand(String uriTemplate, Map<String,?> uriVariables)
UriTemplateHandlerexpand in interface UriTemplateHandleruriTemplate - the URI template stringuriVariables - the URI variablespublic URI expand(String uriTemplate, Object... uriVariables)
UriTemplateHandlerexpand in interface UriTemplateHandleruriTemplate - the URI template stringuriVariables - the URI variable valuesprotected abstract URI expandInternal(String uriTemplate, Map<String,?> uriVariables)