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. |
LinkBuilder |
linkForItemResource(Class<?> type,
Object id)
Returns a
LinkBuilder able to create links to the controller managing the given entity type and id. |
Link |
linkToCollectionResource(Class<?> type)
Creates a
Link pointing to the collection resource of the given type. |
Link |
linkToItemResource(Class<?> type,
Object id)
Creates a
Link pointing to item resource backing the given entity type and id. |
boolean |
supports(Class<?> delimiter) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forType, forType, linkForItemResource, linkToItemResource
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 IanaLinkRelations.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 linkToItemResource(Class<?> type, Object id)
EntityLinks
Link
pointing to item 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 IanaLinkRelations.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 LinkBuilder linkForItemResource(Class<?> type, Object id)
EntityLinks
LinkBuilder
able to create links to the controller managing the given entity type and id.
Implementations will know about the URI structure being used to expose item-resource URIs.linkForItemResource
in interface EntityLinks
linkForItemResource
in class AbstractEntityLinks
type
- the entity type to point to, must not be null.id
- the id of the object of the handed type, must not be null.LinkBuilder
pointing to the item resource identified by the given type and id. Will never be
null.public boolean supports(Class<?> delimiter)
Copyright © 2011–2021 VMware, Inc.. All rights reserved.