public class RootUriTemplateHandler
extends java.lang.Object
implements org.springframework.web.util.UriTemplateHandler
UriTemplateHandler
to set the root for URI that starts with '/'
.Modifier | Constructor and Description |
---|---|
|
RootUriTemplateHandler(java.lang.String rootUri)
Create a new
RootUriTemplateHandler instance. |
|
RootUriTemplateHandler(java.lang.String rootUri,
org.springframework.web.util.UriTemplateHandler handler)
Create a new
RootUriTemplateHandler instance. |
protected |
RootUriTemplateHandler(org.springframework.web.util.UriTemplateHandler handler) |
Modifier and Type | Method and Description |
---|---|
static RootUriTemplateHandler |
addTo(org.springframework.web.client.RestTemplate restTemplate,
java.lang.String rootUri)
Add a
RootUriTemplateHandler instance to the given RestTemplate . |
java.net.URI |
expand(java.lang.String uriTemplate,
java.util.Map<java.lang.String,?> uriVariables) |
java.net.URI |
expand(java.lang.String uriTemplate,
java.lang.Object... uriVariables) |
java.lang.String |
getRootUri() |
RootUriTemplateHandler |
withHandlerWrapper(java.util.function.Function<org.springframework.web.util.UriTemplateHandler,org.springframework.web.util.UriTemplateHandler> wrapper)
Derives a new
RootUriTemplateHandler from this one, wrapping its delegate
{link UriTemplateHandler} by applying the given wrapper . |
protected RootUriTemplateHandler(org.springframework.web.util.UriTemplateHandler handler)
public RootUriTemplateHandler(java.lang.String rootUri)
RootUriTemplateHandler
instance.rootUri
- the root URI to be used to prefix relative URLspublic RootUriTemplateHandler(java.lang.String rootUri, org.springframework.web.util.UriTemplateHandler handler)
RootUriTemplateHandler
instance.rootUri
- the root URI to be used to prefix relative URLshandler
- the delegate handlerpublic java.net.URI expand(java.lang.String uriTemplate, java.util.Map<java.lang.String,?> uriVariables)
expand
in interface org.springframework.web.util.UriTemplateHandler
public java.net.URI expand(java.lang.String uriTemplate, java.lang.Object... uriVariables)
expand
in interface org.springframework.web.util.UriTemplateHandler
public java.lang.String getRootUri()
public RootUriTemplateHandler withHandlerWrapper(java.util.function.Function<org.springframework.web.util.UriTemplateHandler,org.springframework.web.util.UriTemplateHandler> wrapper)
RootUriTemplateHandler
from this one, wrapping its delegate
{link UriTemplateHandler} by applying the given wrapper
.wrapper
- the wrapper to apply to the delegate URI template handlerpublic static RootUriTemplateHandler addTo(org.springframework.web.client.RestTemplate restTemplate, java.lang.String rootUri)
RootUriTemplateHandler
instance to the given RestTemplate
.restTemplate
- the RestTemplate
to add the handler torootUri
- the root URIRootUriTemplateHandler
.