|
Spring Hateoas | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.hateoas.mvc.ControllerLinkBuilderFactory
public class ControllerLinkBuilderFactory
Factory for LinkBuilderSupport instances based on the request mapping annotated on the given controller.
| Constructor Summary | |
|---|---|
ControllerLinkBuilderFactory()
|
|
| Method Summary | |
|---|---|
protected UriComponentsBuilder |
applyUriComponentsContributer(UriComponentsBuilder builder,
DummyInvocationUtils.MethodInvocation invocation)
Applies the configured UriComponentsContributors to the given UriComponentsBuilder. |
ControllerLinkBuilder |
linkTo(Class<?> controller)
Creates a new LinkBuilder with a base of the mapping annotated to the given target clas (controller,
service, etc.). |
ControllerLinkBuilder |
linkTo(Class<?> controller,
Object... parameters)
Creates a new LinkBuilder with a base of the mapping annotated to the given target class (controller,
service, etc.). |
ControllerLinkBuilder |
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. |
ControllerLinkBuilder |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ControllerLinkBuilderFactory()
| Method Detail |
|---|
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 ControllerLinkBuilder linkTo(Class<?> controller)
LinkBuilderFactoryLinkBuilder with a base of the mapping annotated to the given target clas (controller,
service, etc.).
linkTo in interface LinkBuilderFactory<ControllerLinkBuilder>controller - must not be null.
public ControllerLinkBuilder 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<ControllerLinkBuilder>controller - must not be null.parameters - must not be null.
public ControllerLinkBuilder 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 ControllerLinkBuilder.linkTo(Object) for an example.
linkTo in interface MethodLinkBuilderFactory<ControllerLinkBuilder>invocationValue - must not be null.
ControllerLinkBuilder.linkTo(Object)
public ControllerLinkBuilder linkTo(Method method,
Object... parameters)
MethodLinkBuilderFactoryLinkBuilder pointing to the URI mapped to the given Method and expanding this mapping
using the given parameters.
linkTo in interface MethodLinkBuilderFactory<ControllerLinkBuilder>method - must not be null.
protected UriComponentsBuilder applyUriComponentsContributer(UriComponentsBuilder builder,
DummyInvocationUtils.MethodInvocation invocation)
UriComponentsContributors to the given UriComponentsBuilder.
builder - will never be null.invocation - will never be null.
|
Spring Hateoas | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||