Package com.jalios.jcms.restv2
Class PagerData
java.lang.Object
com.jalios.jcms.restv2.PagerData
This object contains the business logic that takes parameters in j2eeRequest and create the
pagerHandler associated.
It is iterable, and the iteration is done through objects contained in the colelction set by setCollection()
and for the scope computed by the parameters.
- Since:
- JCMS-6.0
- Author:
- dissert
-
Constructor Summary
ConstructorsConstructorDescriptionPagerData(javax.ws.rs.core.UriInfo uriInfo, javax.servlet.http.HttpServletRequest j2eeRequest) -
Method Summary
Modifier and TypeMethodDescriptionintgetSort()intgetStart()intgetTotal()booleanvoidinitFromFormParameters(LinkedHashMap<String, List<String>> parametersMap) voidinitFromRequestBody(PagingDTO params) booleanbooleanbooleaniterator()voidsetCollection(Collection collection) Set the collection associated with this page, the collection must be sorted, so a sort is done by default inside.voidsetCollection(Collection collection, boolean collectionAlreaySorted) Set the collection associated with this page, the collection must be sorted, so a sort is done by default.voidsetCollectionTagAttributeMap(Map<String, String> collectionAttributeMap) voidsetCollectionTagName(String collectionTagName) voidsetFromPageResult(PageResult<?> pageResult) Set the paginated result from a PageResult instance.voidsetFromPageResult(PageResult<?> pageResult, boolean collectionAlreaySorted) Set the paginated result from a PageResult instance.voidsetItemTagName(String itemTagName) voidsetReverse(boolean reverse) voidvoidsetStart(int start) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PagerData
public PagerData(javax.ws.rs.core.UriInfo uriInfo, javax.servlet.http.HttpServletRequest j2eeRequest)
-
-
Method Details
-
initFromFormParameters
-
initFromRequestBody
-
getPageSize
public int getPageSize() -
isPagerAll
public boolean isPagerAll() -
hasRequestPagerData
public boolean hasRequestPagerData() -
getStart
public int getStart() -
setStart
public void setStart(int start) -
getSort
-
setSort
-
isReverse
public boolean isReverse() -
setReverse
public void setReverse(boolean reverse) -
isCollection
public boolean isCollection() -
setFromPageResult
Set the paginated result from a PageResult instance.Warning : this method will apply sorting of the specified result by invoking the comparator retrieved from ComparatorManager. use
setFromPageResult(PageResult, boolean)to skip this ordering if your collection is already sorted.- Parameters:
pageResult- the PageResult computed by your API
-
setFromPageResult
Set the paginated result from a PageResult instance.- Parameters:
pageResult- the PageResult computed by your APIcollectionAlreaySorted- true to indicate the PageResult is already sorted, false to apply sort order (comparator) on collection- Since:
- 10.0.9 / JCMS-11310
-
setCollection
Set the collection associated with this page, the collection must be sorted, so a sort is done by default inside. if another sort should be done, seesetCollection(Collection, boolean)method to disable internalm- Parameters:
collection- theCollection(if the paramter is an instance ofQueryResultSet, the collectionAlreaySorted is ignored and sort is always done onQueryResultSetsort)
-
setCollection
Set the collection associated with this page, the collection must be sorted, so a sort is done by default. The collectionAlreaySorted parameter is present to disable the default sort if needed.- Parameters:
collection- theCollection(if the paramter is an instance ofQueryResultSet, the collectionAlreaySorted is ignored and sort is always done onQueryResultSetsort)collectionAlreaySorted- false is theCollectionis a Data collection which has already been sorted previously
-
getCollectionTagName
-
setCollectionTagName
-
getCollectionTagAttributeMap
-
setCollectionTagAttributeMap
-
getCollectionTagAttributes
-
getItemTagName
-
setItemTagName
-
iterator
-
getTotal
public int getTotal()
-