クラス PaginationInfo

java.lang.Object
org.terasoluna.gfw.web.pagination.PaginationInfo

public class PaginationInfo extends Object
Holds all the information required by the PaginationTag to display pagination functionality.
  • フィールド詳細

  • コンストラクタの詳細

    • PaginationInfo

      public PaginationInfo(org.springframework.data.domain.Page<?> page, String pathTmpl, String queryTmpl, int maxDisplayCount)
      Constructor. Initializes the properties with the arguments passed
      パラメータ:
      page - a Page instance
      pathTmpl - path template of pagination
      queryTmpl - query template of pagination
      maxDisplayCount - max display count
    • PaginationInfo

      public PaginationInfo(org.springframework.data.domain.Page<?> page, String pathTmpl, String queryTmpl, String criteriaQuery, boolean disableHtmlEscapeOfCriteriaQuery, int maxDisplayCount)
      Constructor. Initializes the properties with the arguments passed
      パラメータ:
      page - a Page instance
      pathTmpl - path template of pagination
      queryTmpl - query template of pagination
      criteriaQuery - Query of search criteria
      disableHtmlEscapeOfCriteriaQuery - Flag to indicate whether html escaping of criteriaQuery is to be disabled or not.IF set to true, html escaping of criteriaQuery is disabled.
      maxDisplayCount - max display count
      導入されたバージョン:
      1.0.1
  • メソッドの詳細

    • createAttributeMap

      public static Map<String,Object> createAttributeMap(int pageIndex, int size, org.springframework.data.domain.Sort sort)
      Creates and returns a map of attributes to be used by pagination functionality in displaying the results

      Pagination functionality supports only a single sort order. If a Sort instance containing multiple Order elements is passed as argument, the last Order element will be applicable

      パラメータ:
      pageIndex - index of page number (page index is start with 0).
      size - size of page.
      sort - Sort option for queries.
      戻り値:
      Map<String, Object> instance of attributes
    • getCurrent

      public int getCurrent()
      Fetches the current page number
      戻り値:
      current page number
    • getPathTmpl

      public String getPathTmpl()
      Fetches the path template of pagination
      戻り値:
      String path template of pagination
    • getQueryTmpl

      public String getQueryTmpl()
      Fetches the query template of pagination
      戻り値:
      String query template of pagination
    • getCriteriaQuery

      public String getCriteriaQuery()
      Fetches the query of search criteria
      戻り値:
      String query of search criteria
      導入されたバージョン:
      1.0.1
    • getMaxDisplayCount

      public int getMaxDisplayCount()
      Returns max count of page display
      戻り値:
      String max count of page display
    • getPageUri

      protected org.springframework.web.util.UriComponents getPageUri()
      Returns URI of Pagination
      戻り値:
      String Pagination URI
    • getPageUrl

      public String getPageUrl(int pageIndex)
      Returns paginationURL after setting specified page number and display count to it
      パラメータ:
      pageIndex - index of page number (page index is start with 0).
      戻り値:
      String Pagination URL with URL page number and display count set to it
    • getFirstUrl

      public String getFirstUrl()
      Returns first PaginationURL
      戻り値:
      String first PaginationURL
    • getLastUrl

      public String getLastUrl()
      Returns last PaginationURL
      戻り値:
      String last PaginationURL
    • getPreviousUrl

      public String getPreviousUrl()
      Returns PaginationURL of previous page
      戻り値:
      String PaginationURL of previous page
    • getNextUrl

      public String getNextUrl()
      Returns PaginationURL of next page
      戻り値:
      String PaginationURL of next page
    • isFirstPage

      public boolean isFirstPage()
      checks whether the current page is first page.
      戻り値:
      True, if the current page is the first page. False otherwise.
    • isLastPage

      public boolean isLastPage()
      Determines whether the current page is the last page or not
      戻り値:
      True, if the current page is the last page. False otherwise.
    • isCurrent

      public boolean isCurrent(int page)
      Determines if the page number passed as argument is the currently displayed page number or not
      パラメータ:
      page - page-number
      戻り値:
      True, if the page number passed as argument is the currently displayed page number. False otherwise.
    • getBeginAndEnd

      public PaginationInfo.BeginAndEnd getBeginAndEnd()
      Returns the class that sets start and end page of pagination

      戻り値:
      BeginAndEnd class that sets start and end page of pagination