cn.featherfly.web.pagination.RequestParameterPaginationFactory Maven / Gradle / Ivy
package cn.featherfly.web.pagination;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import cn.featherfly.common.lang.AssertIllegalArgument;
import cn.featherfly.common.lang.NumberUtils;
import cn.featherfly.common.structure.page.Pagination;
import cn.featherfly.common.structure.page.SimplePagination;
/**
*
* SimplePaginationFactory
*
*
* @author 钟冀
*/
public class RequestParameterPaginationFactory implements PaginationFactory{
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
/**
* {@inheritDoc}
*/
@Override
public Pagination create(HttpServletRequest request) {
Object p = request.getParameter(pageNumberName);
Integer pageNumber = NumberUtils.parse(p + "", defaultPageNumber);
SimplePagination