public class DelegatingEntityLinks extends Object implements EntityLinks
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, waitforType, forType, linkForItemResource, linkToItemResourcepublic DelegatingEntityLinks(org.springframework.plugin.core.PluginRegistry<EntityLinks,Class<?>> plugins)
DelegatingEntityLinks using the given PluginRegistry.plugins - must not be null.public LinkBuilder linkFor(Class<?> type)
EntityLinksLinkBuilder 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).linkFor in interface EntityLinkstype - 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)
EntityLinksLinkBuilder 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.linkFor in interface EntityLinkstype - the entity type to point to, must not be null.LinkBuilder pointing to the collection resource.public Link linkToCollectionResource(Class<?> type)
EntityLinksLink 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.linkToCollectionResource in interface EntityLinkstype - 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)
EntityLinksLink 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.linkToItemResource in interface EntityLinkstype - 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)
EntityLinksLinkBuilder 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 EntityLinkstype - 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.Copyright © 2011–2021 Pivotal, Inc.. All rights reserved.