public class DelegatingEntityLinks extends AbstractEntityLinks
EntityLinks
implementation that delegates to the EntityLinks
instances registered in the
PluginRegistry
given on instance creation.Constructor and Description |
---|
DelegatingEntityLinks(org.springframework.plugin.core.PluginRegistry<EntityLinks,Class<?>> plugins)
Creates a new
DelegatingEntityLinks using the given PluginRegistry . |
Modifier and Type | Method and Description |
---|---|
LinkBuilder |
linkFor(Class<?> type)
Returns a
LinkBuilder able to create links to the controller managing the given entity type. |
LinkBuilder |
linkFor(Class<?> type,
Object... parameters)
Returns a
LinkBuilder able to create links to the controller managing the given entity type, unfolding the
given parameters into the URI template the backing controller is mapped to. |
Link |
linkToCollectionResource(Class<?> type)
Creates a
Link pointing to the collection resource of the given type. |
Link |
linkToSingleResource(Class<?> type,
Object id)
Creates a
Link pointing to single resource backing the given entity type and id. |
boolean |
supports(Class<?> delimiter) |
linkForSingleResource, linkForSingleResource, linkToSingleResource
public DelegatingEntityLinks(org.springframework.plugin.core.PluginRegistry<EntityLinks,Class<?>> plugins)
DelegatingEntityLinks
using the given PluginRegistry
.plugins
- must not be null.public LinkBuilder linkFor(Class<?> type)
EntityLinks
LinkBuilder
able to create links to the controller managing the given entity type. Expects a
controller being mapped to a fully expanded URI template (i.e. not path variables being used).type
- the entity type to point to, must not be null.LinkBuilder
pointing to the collection resource. Will never be null.public LinkBuilder linkFor(Class<?> type, Object... parameters)
EntityLinks
LinkBuilder
able to create links to the controller managing the given entity type, unfolding the
given parameters into the URI template the backing controller is mapped to.type
- the entity type to point to, must not be null.LinkBuilder
pointing to the collection resource.public Link linkToCollectionResource(Class<?> type)
EntityLinks
Link
pointing to the collection resource of the given type. The relation type of the link will be
determined by the implementation class and should be defaulted to Link.REL_SELF
.type
- the entity type to point to, must not be null.Link
pointing to the collection resource exposed for the given entity. Will never be
null.public Link linkToSingleResource(Class<?> type, Object id)
EntityLinks
Link
pointing to single resource backing the given entity type and id. The relation type of the
link will be determined by the implementation class and should be defaulted to Link.REL_SELF
.type
- the entity type to point to, must not be null.id
- the identifier of the entity of the given typeLink
pointing to the resource exposed for the entity with the given type and id. Will never be
null.public boolean supports(Class<?> delimiter)
Copyright © 2012-2016–2018 Pivotal, Inc.. All rights reserved.