Class WebMvcLinkBuilderFactory
java.lang.Object
org.springframework.hateoas.server.mvc.WebMvcLinkBuilderFactory
- All Implemented Interfaces:
LinkBuilderFactory<WebMvcLinkBuilder>,MethodLinkBuilderFactory<WebMvcLinkBuilder>
public class WebMvcLinkBuilderFactory
extends Object
implements MethodLinkBuilderFactory<WebMvcLinkBuilder>
Factory for
LinkBuilderSupport instances based on the request mapping annotated on the given controller.- Author:
- Ricardo Gladwell, Oliver Gierke, Dietrich Schulten, Kamill Sokol, Ross Turner, Oemer Yildiz, Kevin Conaway, Andrew Naydyonock, Greg Turnquist, Réda Housni Alaoui
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a newLinkBuilderwith a base of the mapping annotated to the given target class (controller, service, etc.).Creates a newLinkBuilderwith a base of the mapping annotated to the given target class (controller, service, etc.).Returns aLinkBuilderpointing to the URI mapped to the givenMethodassuming it was invoked on an object of the given type expanding the mapping using null values as parameters.Returns aLinkBuilderpointing to the URI mapped to the givenMethodassuming it was invoked on an object of the given type.Creates a newLinkBuilderwith a base of the mapping annotated to the given target class (controller, service, etc.).Returns aLinkBuilderpointing to the URI mapped to the method the result is handed into this method.Returns aLinkBuilderpointing to the URI mapped to the givenMethodand expanding this mapping using null values as parameters.Returns aLinkBuilderpointing to the URI mapped to the givenMethodand expanding this mapping using the given parameters.voidsetUriComponentsContributors(List<? extends UriComponentsContributor> uriComponentsContributors) Configures theUriComponentsContributorto be used when buildingLinkinstances from method invocations.
-
Constructor Details
-
WebMvcLinkBuilderFactory
public WebMvcLinkBuilderFactory()
-
-
Method Details
-
setUriComponentsContributors
public void setUriComponentsContributors(List<? extends UriComponentsContributor> uriComponentsContributors) Configures theUriComponentsContributorto be used when buildingLinkinstances from method invocations.- Parameters:
uriComponentsContributors- the uriComponentsContributors to set- See Also:
-
linkTo
Description copied from interface:LinkBuilderFactoryCreates a newLinkBuilderwith a base of the mapping annotated to the given target class (controller, service, etc.).- Specified by:
linkToin interfaceLinkBuilderFactory<WebMvcLinkBuilder>- Parameters:
controller- must not be null.- Returns:
-
linkTo
Description copied from interface:LinkBuilderFactoryCreates a newLinkBuilderwith 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.- Specified by:
linkToin interfaceLinkBuilderFactory<WebMvcLinkBuilder>- Parameters:
controller- must not be null.parameters- must not be null.- Returns:
-
linkTo
Description copied from interface:LinkBuilderFactoryCreates a newLinkBuilderwith 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.- Specified by:
linkToin interfaceLinkBuilderFactory<WebMvcLinkBuilder>- Parameters:
controller- must not be null.parameters- must not be null.- Returns:
-
linkTo
Description copied from interface:MethodLinkBuilderFactoryReturns aLinkBuilderpointing to the URI mapped to the givenMethodand expanding this mapping using null values as parameters.- Specified by:
linkToin interfaceMethodLinkBuilderFactory<WebMvcLinkBuilder>- Parameters:
method- must not be null.- Returns:
-
linkTo
Description copied from interface:MethodLinkBuilderFactoryReturns aLinkBuilderpointing to the URI mapped to the givenMethodand expanding this mapping using the given parameters. The number of parameter values has to match the length of the given method's expected parameters.- Specified by:
linkToin interfaceMethodLinkBuilderFactory<WebMvcLinkBuilder>- Parameters:
method- must not be null.- Returns:
-
linkTo
Description copied from interface:MethodLinkBuilderFactoryReturns aLinkBuilderpointing to the URI mapped to the givenMethodassuming it was invoked on an object of the given type expanding the mapping using null values as parameters.- Specified by:
linkToin interfaceMethodLinkBuilderFactory<WebMvcLinkBuilder>- Parameters:
type- must not be null.method- must not be null.- Returns:
-
linkTo
Description copied from interface:MethodLinkBuilderFactoryReturns aLinkBuilderpointing to the URI mapped to the givenMethodassuming 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.- Specified by:
linkToin interfaceMethodLinkBuilderFactory<WebMvcLinkBuilder>- Parameters:
controller- must not be null.method- must not be null.- Returns:
-
linkTo
Description copied from interface:MethodLinkBuilderFactoryReturns aLinkBuilderpointing to the URI mapped to the method the result is handed into this method. UseDummyInvocationUtils#methodOn(Class, Object...)to obtain a dummy instance of a controller to record a dummy method invocation on. SeeWebMvcLinkBuilder#linkTo(Object)for an example.- Specified by:
linkToin interfaceMethodLinkBuilderFactory<WebMvcLinkBuilder>- Parameters:
invocationValue- must not be null.- Returns:
- See Also:
-
WebMvcLinkBuilder#linkTo(Object)
-