Interface LinkRelationProvider
- All Superinterfaces:
org.springframework.plugin.core.Plugin<LinkRelationProvider.LookupContext>
- All Known Implementing Classes:
AnnotationLinkRelationProvider,ControllerLinkRelationProvider,DefaultLinkRelationProvider,DelegatingLinkRelationProvider,EvoInflectorLinkRelationProvider
public interface LinkRelationProvider
extends org.springframework.plugin.core.Plugin<LinkRelationProvider.LookupContext>
API to provide
LinkRelations for collections and items of the given type. Implementations can be selected
based on the LinkRelationProvider.LookupContext, for item resource relations, collection resource relations or both.- Author:
- Oliver Gierke
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classLinkRelationProviderselection context for item resource relation lookups (LinkRelationProvider.LookupContext.forItemResourceRelLookup(Class), collection resource relation lookupsLinkRelationProvider.LookupContext.forCollectionResourceRelLookup(Class)or bothLinkRelationProvider.LookupContext.forType(Class). -
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.booleansupports(LinkRelationProvider.LookupContext delimiter) Callback method to manually selectLinkRelationProviderimplementations based on a givenLinkRelationProvider.LookupContext.
-
Method Details
-
getItemResourceRelFor
Returns the relation type to be used to point to an item resource of the given type.- Parameters:
type- must not be null.- Returns:
-
getCollectionResourceRelFor
Returns the relation type to be used to point to a collection resource of the given type.- Parameters:
type- must not be null.- Returns:
-
supports
Callback 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 ofgetItemResourceRelFor(Class)andgetCollectionResourceRelFor(Class)transparently.- Specified by:
supportsin interfaceorg.springframework.plugin.core.Plugin<LinkRelationProvider.LookupContext>- See Also:
-
Plugin.supports(java.lang.Object)
-