public abstract class AbstractUriTemplateHandler extends java.lang.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 |
---|---|
java.net.URI |
expand(java.lang.String uriTemplate,
java.util.Map<java.lang.String,?> uriVariables)
Expand the given URI template from a map of URI variables.
|
java.net.URI |
expand(java.lang.String uriTemplate,
java.lang.Object... uriVariables)
Expand the given URI template from an array of URI variables.
|
protected abstract java.net.URI |
expandInternal(java.lang.String uriTemplate,
java.util.Map<java.lang.String,?> uriVariables)
Actually expand and encode the URI template.
|
protected abstract java.net.URI |
expandInternal(java.lang.String uriTemplate,
java.lang.Object... uriVariables)
Actually expand and encode the URI template.
|
java.lang.String |
getBaseUrl()
Return the configured base URL.
|
java.util.Map<java.lang.String,?> |
getDefaultUriVariables()
Return a read-only copy of the configured default URI variables.
|
void |
setBaseUrl(java.lang.String baseUrl)
Configure a base URL to prepend URI templates with.
|
void |
setDefaultUriVariables(java.util.Map<java.lang.String,?> defaultUriVariables)
Configure default URI variable values to use with every expanded URI
template.
|
public void setBaseUrl(java.lang.String baseUrl)
UriComponentsBuilder
.baseUrl
- the base URL.public java.lang.String getBaseUrl()
public void setDefaultUriVariables(java.util.Map<java.lang.String,?> defaultUriVariables)
expand(String, Map)
can override the default values.defaultUriVariables
- the default URI variable valuespublic java.util.Map<java.lang.String,?> getDefaultUriVariables()
public java.net.URI expand(java.lang.String uriTemplate, java.util.Map<java.lang.String,?> uriVariables)
UriTemplateHandler
expand
in interface UriTemplateHandler
uriTemplate
- the URI template stringuriVariables
- the URI variablespublic java.net.URI expand(java.lang.String uriTemplate, java.lang.Object... uriVariables)
UriTemplateHandler
expand
in interface UriTemplateHandler
uriTemplate
- the URI template stringuriVariables
- the URI variable valuesprotected abstract java.net.URI expandInternal(java.lang.String uriTemplate, java.util.Map<java.lang.String,?> uriVariables)
protected abstract java.net.URI expandInternal(java.lang.String uriTemplate, java.lang.Object... uriVariables)