Class DelegatingLinkRelationProvider
java.lang.Object
org.springframework.hateoas.server.core.DelegatingLinkRelationProvider
- All Implemented Interfaces:
LinkRelationProvider
,org.springframework.plugin.core.Plugin<LinkRelationProvider.LookupContext>
- Author:
- Oliver Gierke
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.hateoas.server.LinkRelationProvider
LinkRelationProvider.LookupContext
-
Constructor Summary
ConstructorDescriptionDelegatingLinkRelationProvider
(LinkRelationProvider... providers) Creates a newDefaultLinkRelationProvider
for the givenLinkRelationProvider
s.DelegatingLinkRelationProvider
(org.springframework.plugin.core.PluginRegistry<LinkRelationProvider, LinkRelationProvider.LookupContext> providers) -
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.boolean
supports
(LinkRelationProvider.LookupContext delimiter) Callback method to manually selectLinkRelationProvider
implementations based on a givenLinkRelationProvider.LookupContext
.
-
Constructor Details
-
DelegatingLinkRelationProvider
Creates a newDefaultLinkRelationProvider
for the givenLinkRelationProvider
s.- Parameters:
providers
- must not be null.
-
DelegatingLinkRelationProvider
public DelegatingLinkRelationProvider(org.springframework.plugin.core.PluginRegistry<LinkRelationProvider, LinkRelationProvider.LookupContext> providers)
-
-
Method Details
-
getItemResourceRelFor
Description copied from interface:LinkRelationProvider
Returns the relation type to be used to point to an item resource of the given type.- Specified by:
getItemResourceRelFor
in interfaceLinkRelationProvider
- Parameters:
type
- must not be null.- Returns:
-
getCollectionResourceRelFor
Description copied from interface:LinkRelationProvider
Returns the relation type to be used to point to a collection resource of the given type.- Specified by:
getCollectionResourceRelFor
in interfaceLinkRelationProvider
- Parameters:
type
- must not be null.- Returns:
-
supports
Description copied from interface:LinkRelationProvider
Callback method to manually selectLinkRelationProvider
implementations based on a givenLinkRelationProvider.LookupContext
. User code shouldn't need to call this method explicitly but rather useDelegatingLinkRelationProvider
, equip that with a set ofLinkRelationProvider
implementations as that will perform the selection of the matching one on invocations ofLinkRelationProvider.getItemResourceRelFor(Class)
andLinkRelationProvider.getCollectionResourceRelFor(Class)
transparently.- Specified by:
supports
in interfaceLinkRelationProvider
- Specified by:
supports
in interfaceorg.springframework.plugin.core.Plugin<LinkRelationProvider.LookupContext>
- See Also:
-
Plugin.supports(java.lang.Object)
-