Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package org.springframework.data.web;
import java.util.Iterator;
import org.springframework.core.MethodParameter;
import org.springframework.core.Ordered;
import org.springframework.data.domain.OffsetRequest;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.domain.Sort.Order;
import org.springframework.util.Assert;
import org.springframework.web.bind.support.WebDataBinderFactory;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.ModelAndViewContainer;
public class PageableHandlerMethodArgumentResolverCustom extends PageableHandlerMethodArgumentResolver implements Ordered {
private static final String DEFAULT_NEXT_PARAMETER = "next";
private static final String DEFAULT_PREV_PARAMETER = "prev";
private static final String DEFAULT_ALL_PARAMETER = "all";
static final Order DEFAULT_ORDER = new Order(Direction.DESC, "id");
private Order fallbackOrder = DEFAULT_ORDER;
private String nextParameterName = DEFAULT_NEXT_PARAMETER;
private String prevParameterName = DEFAULT_PREV_PARAMETER;
private String allParameterName = DEFAULT_ALL_PARAMETER;
private int order = 0;
public PageableHandlerMethodArgumentResolverCustom(SortHandlerMethodArgumentResolver sortResolver) {
super(sortResolver);
setFallbackPageable(new PageRequest(0, 10, new org.springframework.data.domain.Sort(this.fallbackOrder)));
setMaxPageSize(Integer.MAX_VALUE);
}
public void setFallbackOrder(Order order) {
Assert.notNull(order, "Order must not be null!");
this.fallbackOrder = order;
}
public void setNextParameterName(String nextParameterName) {
Assert.hasText(nextParameterName, "Next parameter name must not be null or empty!");
this.nextParameterName = nextParameterName;
}
public void setPrevParameterName(String prevParameterName) {
Assert.hasText(prevParameterName, "Prev parameter name must not be null or empty!");
this.prevParameterName = prevParameterName;
}
public void setAllParameterName(String allParameterName) {
Assert.hasText(allParameterName, "All parameter name must not be null or empty!");
this.allParameterName = allParameterName;
}
/**
*