public class ControllerLinkRelationProvider extends Object implements LinkRelationProvider
LinkRelationProvider
inspecting ExposesResourceFor
annotations on controller classes.LinkRelationProvider.LookupContext
Constructor and Description |
---|
ControllerLinkRelationProvider(Class<?> controller,
org.springframework.plugin.core.PluginRegistry<LinkRelationProvider,LinkRelationProvider.LookupContext> providers)
Creates a new
ControllerLinkRelationProvider |
Modifier and Type | Method and Description |
---|---|
LinkRelation |
getCollectionResourceRelFor(Class<?> resource)
Returns the relation type to be used to point to a collection resource of the given type.
|
LinkRelation |
getItemResourceRelFor(Class<?> resource)
Returns the relation type to be used to point to an item resource of the given type.
|
boolean |
supports(LinkRelationProvider.LookupContext context)
Callback method to manually select
LinkRelationProvider implementations based on a given
LinkRelationProvider.LookupContext . |
public ControllerLinkRelationProvider(Class<?> controller, org.springframework.plugin.core.PluginRegistry<LinkRelationProvider,LinkRelationProvider.LookupContext> providers)
ControllerLinkRelationProvider
controller
- must not be null.providers
- must not be null.public LinkRelation getItemResourceRelFor(Class<?> resource)
LinkRelationProvider
getItemResourceRelFor
in interface LinkRelationProvider
resource
- must not be null.public LinkRelation getCollectionResourceRelFor(Class<?> resource)
LinkRelationProvider
getCollectionResourceRelFor
in interface LinkRelationProvider
resource
- must not be null.public boolean supports(LinkRelationProvider.LookupContext context)
LinkRelationProvider
LinkRelationProvider
implementations based on a given
LinkRelationProvider.LookupContext
. User code shouldn't need to call this method explicitly but rather use
DelegatingLinkRelationProvider
, equip that with a set of LinkRelationProvider
implementations as
that will perform the selection of the matching one on invocations of LinkRelationProvider.getItemResourceRelFor(Class)
and
LinkRelationProvider.getCollectionResourceRelFor(Class)
transparently.supports
in interface LinkRelationProvider
supports
in interface org.springframework.plugin.core.Plugin<LinkRelationProvider.LookupContext>
Plugin.supports(java.lang.Object)
Copyright © 2011–2020 Pivotal, Inc.. All rights reserved.