public class WebMvcLinkBuilderFactory extends Object implements MethodLinkBuilderFactory<WebMvcLinkBuilder>
LinkBuilderSupport instances based on the request mapping annotated on the given controller.| Constructor and Description |
|---|
WebMvcLinkBuilderFactory() |
| Modifier and Type | Method and Description |
|---|---|
WebMvcLinkBuilder |
linkTo(Class<?> controller)
Creates a new
LinkBuilder with a base of the mapping annotated to the given target class (controller,
service, etc.). |
WebMvcLinkBuilder |
linkTo(Class<?> controller,
Map<String,?> parameters)
Creates a new
LinkBuilder with a base of the mapping annotated to the given target class (controller,
service, etc.). |
WebMvcLinkBuilder |
linkTo(Class<?> type,
Method method)
Returns a
LinkBuilder pointing to the URI mapped to the given Method assuming it was invoked on an
object of the given type expanding the mapping using null values as parameters. |
WebMvcLinkBuilder |
linkTo(Class<?> controller,
Method method,
Object... parameters)
Returns a
LinkBuilder pointing to the URI mapped to the given Method assuming it was invoked on an
object of the given type. |
WebMvcLinkBuilder |
linkTo(Class<?> controller,
Object... parameters)
Creates a new
LinkBuilder with a base of the mapping annotated to the given target class (controller,
service, etc.). |
WebMvcLinkBuilder |
linkTo(Method method)
Returns a
LinkBuilder pointing to the URI mapped to the given Method and expanding this mapping
using null values as parameters. |
WebMvcLinkBuilder |
linkTo(Method method,
Object... parameters)
Returns a
LinkBuilder pointing to the URI mapped to the given Method and expanding this mapping
using the given parameters. |
WebMvcLinkBuilder |
linkTo(Object invocationValue)
Returns a
LinkBuilder pointing to the URI mapped to the method the result is handed into this method. |
void |
setUriComponentsContributors(List<? extends UriComponentsContributor> uriComponentsContributors)
Configures the
UriComponentsContributor to be used when building Link instances from method
invocations. |
public void setUriComponentsContributors(List<? extends UriComponentsContributor> uriComponentsContributors)
UriComponentsContributor to be used when building Link instances from method
invocations.uriComponentsContributors - the uriComponentsContributors to setlinkTo(Object)public WebMvcLinkBuilder linkTo(Class<?> controller)
LinkBuilderFactoryLinkBuilder with a base of the mapping annotated to the given target class (controller,
service, etc.).linkTo in interface LinkBuilderFactory<WebMvcLinkBuilder>controller - must not be null.public WebMvcLinkBuilder linkTo(Class<?> controller, Object... parameters)
LinkBuilderFactoryLinkBuilder with a base of the mapping annotated to the given target class (controller,
service, etc.). The additional parameters are used to fill up potentially available path variables in the class
scope request mapping.linkTo in interface LinkBuilderFactory<WebMvcLinkBuilder>controller - must not be null.parameters - must not be null.public WebMvcLinkBuilder linkTo(Class<?> controller, Map<String,?> parameters)
LinkBuilderFactoryLinkBuilder with a base of the mapping annotated to the given target class (controller,
service, etc.). Parameter map is used to fill up potentially available path variables in the class scope request
mapping.linkTo in interface LinkBuilderFactory<WebMvcLinkBuilder>controller - must not be null.parameters - must not be null.public WebMvcLinkBuilder linkTo(Method method)
MethodLinkBuilderFactoryLinkBuilder pointing to the URI mapped to the given Method and expanding this mapping
using null values as parameters.linkTo in interface MethodLinkBuilderFactory<WebMvcLinkBuilder>method - must not be null.public WebMvcLinkBuilder linkTo(Method method, Object... parameters)
MethodLinkBuilderFactoryLinkBuilder pointing to the URI mapped to the given Method and expanding this mapping
using the given parameters. The number of parameter values has to match the length of the given method's expected
parameters.linkTo in interface MethodLinkBuilderFactory<WebMvcLinkBuilder>method - must not be null.public WebMvcLinkBuilder linkTo(Class<?> type, Method method)
MethodLinkBuilderFactoryLinkBuilder pointing to the URI mapped to the given Method assuming it was invoked on an
object of the given type expanding the mapping using null values as parameters.linkTo in interface MethodLinkBuilderFactory<WebMvcLinkBuilder>type - must not be null.method - must not be null.public WebMvcLinkBuilder linkTo(Class<?> controller, Method method, Object... parameters)
MethodLinkBuilderFactoryLinkBuilder pointing to the URI mapped to the given Method assuming it was invoked on an
object of the given type. The number of parameter values has to match the length of the given method's expected
parameters.linkTo in interface MethodLinkBuilderFactory<WebMvcLinkBuilder>controller - must not be null.method - must not be null.public WebMvcLinkBuilder linkTo(Object invocationValue)
MethodLinkBuilderFactoryLinkBuilder pointing to the URI mapped to the method the result is handed into this method. Use
DummyInvocationUtils.methodOn(Class, Object...) to obtain a dummy instance of a controller to record a
dummy method invocation on. See WebMvcLinkBuilder.linkTo(Object) for an example.linkTo in interface MethodLinkBuilderFactory<WebMvcLinkBuilder>invocationValue - must not be null.WebMvcLinkBuilder.linkTo(Object)Copyright © 2011–2023 Pivotal, Inc.. All rights reserved.