Class DefaultLinkRelationProvider
java.lang.Object
org.springframework.hateoas.server.core.DefaultLinkRelationProvider
- All Implemented Interfaces:
Ordered,LinkRelationProvider,org.springframework.plugin.core.Plugin<LinkRelationProvider.LookupContext>
- Direct Known Subclasses:
EvoInflectorLinkRelationProvider
Default implementation of
LinkRelationProvider to simply use the uncapitalized version of the given type's
name as item resource LinkRelation as well as an appended List for the collection resource
LinkRelation.- Author:
- Oliver Gierke, Greg Turnquist
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.hateoas.server.LinkRelationProvider
LinkRelationProvider.LookupContext -
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCollectionResourceRelFor(Class<?> type) Returns the relation type to be used to point to a collection resource of the given type.getItemResourceRelFor(Class<?> type) Returns the relation type to be used to point to an item resource of the given type.intgetOrder()booleansupports(LinkRelationProvider.LookupContext delimiter) Callback method to manually selectLinkRelationProviderimplementations based on a givenLinkRelationProvider.LookupContext.
-
Constructor Details
-
DefaultLinkRelationProvider
public DefaultLinkRelationProvider()
-
-
Method Details
-
getCollectionResourceRelFor
Description copied from interface:LinkRelationProviderReturns the relation type to be used to point to a collection resource of the given type.- Specified by:
getCollectionResourceRelForin interfaceLinkRelationProvider- Parameters:
type- must not be null.- Returns:
-
getItemResourceRelFor
Description copied from interface:LinkRelationProviderReturns the relation type to be used to point to an item resource of the given type.- Specified by:
getItemResourceRelForin interfaceLinkRelationProvider- Parameters:
type- must not be null.- Returns:
-
getOrder
public int getOrder() -
supports
Description copied from interface:LinkRelationProviderCallback method to manually selectLinkRelationProviderimplementations based on a givenLinkRelationProvider.LookupContext. User code shouldn't need to call this method explicitly but rather useDelegatingLinkRelationProvider, equip that with a set ofLinkRelationProviderimplementations as that will perform the selection of the matching one on invocations ofLinkRelationProvider.getItemResourceRelFor(Class)andLinkRelationProvider.getCollectionResourceRelFor(Class)transparently.- Specified by:
supportsin interfaceLinkRelationProvider- Specified by:
supportsin interfaceorg.springframework.plugin.core.Plugin<LinkRelationProvider.LookupContext>- See Also:
-
Plugin.supports(java.lang.Object)
-