Search in sources :

Example 1 with PagingSpecUrlBuilder

use of io.crnk.core.queryspec.pagingspec.PagingSpecUrlBuilder in project crnk-framework by crnk-project.

the class ResponseRepositoryAdapter method enrichPageLinksInformation.

private LinksInformation enrichPageLinksInformation(LinksInformation linksInformation, ResourceList<?> resources, QueryAdapter queryAdapter, RepositoryRequestSpec requestSpec) {
    if (linksInformation == null) {
        // use default implementation if no link information
        // provided by resource
        linksInformation = new DefaultPagedLinksInformation();
    }
    if (linksInformation instanceof PagedLinksInformation) {
        PagingSpecUrlBuilder urlBuilder = new PagingSpecUrlBuilder(moduleRegistry.getResourceRegistry(), requestSpec);
        requestSpec.getResponseResourceInformation().getPagingBehavior().build((PagedLinksInformation) linksInformation, resources, queryAdapter, urlBuilder);
    }
    return linksInformation;
}
Also used : DefaultPagedLinksInformation(io.crnk.core.resource.links.DefaultPagedLinksInformation) DefaultPagedLinksInformation(io.crnk.core.resource.links.DefaultPagedLinksInformation) PagedLinksInformation(io.crnk.core.resource.links.PagedLinksInformation) PagingSpecUrlBuilder(io.crnk.core.queryspec.pagingspec.PagingSpecUrlBuilder)

Aggregations

PagingSpecUrlBuilder (io.crnk.core.queryspec.pagingspec.PagingSpecUrlBuilder)1 DefaultPagedLinksInformation (io.crnk.core.resource.links.DefaultPagedLinksInformation)1 PagedLinksInformation (io.crnk.core.resource.links.PagedLinksInformation)1