Module spring.data.rest.webmvc
Class RepositoryEntityLinks
java.lang.Object
org.springframework.hateoas.server.core.AbstractEntityLinks
org.springframework.data.rest.webmvc.support.RepositoryEntityLinks
- All Implemented Interfaces:
EntityLinks,org.springframework.plugin.core.Plugin<Class<?>>
EntityLinks implementation that is able to create Link for domain classes managed by Spring Data
REST.- Author:
- Jon Brisbin, Oliver Gierke
-
Constructor Summary
ConstructorsConstructorDescriptionRepositoryEntityLinks(Repositories repositories, org.springframework.data.rest.core.mapping.ResourceMappings mappings, org.springframework.data.rest.core.config.RepositoryRestConfiguration config, PagingAndSortingTemplateVariables templateVariables, org.springframework.plugin.core.PluginRegistry<BackendIdConverter, Class<?>> idConverters) RepositoryEntityLinks(Repositories repositories, org.springframework.data.rest.core.mapping.ResourceMappings mappings, org.springframework.data.rest.core.config.RepositoryRestConfiguration config, Lazy<PagingAndSortingTemplateVariables> templateVariables, org.springframework.plugin.core.PluginRegistry<BackendIdConverter, Class<?>> idConverters) -
Method Summary
Modifier and TypeMethodDescriptionlinkForItemResource(Class<?> type, Object id) linksToSearchResources(Class<?> type) Returns all links to search resource for the given type.linksToSearchResources(Class<?> type, Pageable pageable) Returns all link to search resources for the given type, pre-expanded with the givenPageableif applicable.linksToSearchResources(Class<?> type, Sort sort) Returns all link to search resources for the given type, pre-expanded with the givenSortif applicable.linkToCollectionResource(Class<?> type) linkToItemResource(Class<?> type, Object id) linkToPagedResource(Class<?> type, Pageable pageable) Returns the link to to the paged colelction resource for the given type, pre-expanding thelinkToSearchResource(Class<?> domainType, LinkRelation relation) Creates the link to the search resource with the givenLinkRelationfor a given type.linkToSearchResource(Class<?> domainType, LinkRelation relation, Pageable pageable) Creates the link to the search resource with the givenLinkRelationfor a given type.linkToSearchResource(Class<?> domainType, LinkRelation relation, Sort sort) Creates the link to the search resource with the givenLinkRelationfor a given type.booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.hateoas.server.EntityLinks
forType, forType, linkForItemResource, linkToItemResource
-
Constructor Details
-
RepositoryEntityLinks
public RepositoryEntityLinks(Repositories repositories, org.springframework.data.rest.core.mapping.ResourceMappings mappings, org.springframework.data.rest.core.config.RepositoryRestConfiguration config, PagingAndSortingTemplateVariables templateVariables, org.springframework.plugin.core.PluginRegistry<BackendIdConverter, Class<?>> idConverters) -
RepositoryEntityLinks
public RepositoryEntityLinks(Repositories repositories, org.springframework.data.rest.core.mapping.ResourceMappings mappings, org.springframework.data.rest.core.config.RepositoryRestConfiguration config, Lazy<PagingAndSortingTemplateVariables> templateVariables, org.springframework.plugin.core.PluginRegistry<BackendIdConverter, Class<?>> idConverters)
-
-
Method Details
-
supports
-
linkFor
-
linkFor
-
linkToPagedResource
Returns the link to to the paged colelction resource for the given type, pre-expanding the- Parameters:
type- must not be null.pageable- the pageable to can be null.- Returns:
-
linkToCollectionResource
-
linkToItemResource
-
linkForItemResource
- Specified by:
linkForItemResourcein interfaceEntityLinks- Overrides:
linkForItemResourcein classAbstractEntityLinks
-
linksToSearchResources
Returns all links to search resource for the given type.- Parameters:
type- must not be null.- Returns:
- Since:
- 2.3
-
linksToSearchResources
Returns all link to search resources for the given type, pre-expanded with the givenPageableif applicable.- Parameters:
type- must not be null.pageable- can be null.- Returns:
- Since:
- 2.3
-
linksToSearchResources
Returns all link to search resources for the given type, pre-expanded with the givenSortif applicable.- Parameters:
type- must not be null.sort- can be null.- Returns:
- Since:
- 2.3
-
linkToSearchResource
Creates the link to the search resource with the givenLinkRelationfor a given type.- Parameters:
domainType- must not be null.relation- must not be null.- Returns:
- Since:
- 2.3
-
linkToSearchResource
Creates the link to the search resource with the givenLinkRelationfor a given type. Uses the givenPageableto pre-expand potentially available template variables.- Parameters:
domainType- must not be null.relation- must not be null.pageable- can be null.- Returns:
- Since:
- 2.3
-
linkToSearchResource
Creates the link to the search resource with the givenLinkRelationfor a given type. Uses the givenSortto pre-expand potentially available template variables.- Parameters:
domainType- must not be null.relation- must not be null.sort- can be null.- Returns:
- Since:
- 2.3
-