Package com.jalios.jcms.rest
Class PagerData
- java.lang.Object
-
- com.jalios.jcms.rest.PagerData
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>
public class PagerData extends java.lang.Object implements java.lang.Iterable<java.lang.Object>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
Constructors Constructor Description PagerData(org.restlet.data.Request request, javax.servlet.http.HttpServletRequest j2eeRequest)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>getCollectionTagAttributeMap()java.lang.StringgetCollectionTagAttributes()java.lang.StringgetCollectionTagName()java.lang.StringgetItemTagName()intgetPageSize()java.lang.StringgetSort()intgetStart()intgetTotal()booleanhasRequestPagerData()voidinitFromFormParameters(java.util.LinkedHashMap<java.lang.String,java.util.List<java.lang.String>> parametersMap)booleanisCollection()booleanisPagerAll()booleanisReverse()java.util.Iteratoriterator()voidsetCollection(java.util.Collection collection)Set the collection associated with this page, the collection must be sorted, so a sort is done by default inside.voidsetCollection(java.util.Collection collection, boolean collectionAlreaySorted)Set the collection associated with this page, the collection must be sorted, so a sort is done by default.voidsetCollectionTagAttributeMap(java.util.Map<java.lang.String,java.lang.String> collectionAttributeMap)voidsetCollectionTagName(java.lang.String collectionTagName)voidsetFromPageResult(PageResult<?> pageResult)voidsetItemTagName(java.lang.String itemTagName)voidsetReverse(boolean reverse)voidsetSort(java.lang.String sort)voidsetStart(int start)java.lang.StringtoXmlString()
-
-
-
Method Detail
-
initFromFormParameters
public void initFromFormParameters(java.util.LinkedHashMap<java.lang.String,java.util.List<java.lang.String>> parametersMap)
-
getPageSize
public int getPageSize()
-
isPagerAll
public boolean isPagerAll()
-
hasRequestPagerData
public boolean hasRequestPagerData()
-
getStart
public int getStart()
-
setStart
public void setStart(int start)
-
getSort
public java.lang.String getSort()
-
setSort
public void setSort(java.lang.String sort)
-
isReverse
public boolean isReverse()
-
setReverse
public void setReverse(boolean reverse)
-
isCollection
public boolean isCollection()
-
setFromPageResult
public void setFromPageResult(PageResult<?> pageResult)
-
setCollection
public void setCollection(java.util.Collection collection)
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
public void setCollection(java.util.Collection collection, boolean collectionAlreaySorted)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
public java.lang.String getCollectionTagName()
-
setCollectionTagName
public void setCollectionTagName(java.lang.String collectionTagName)
-
getCollectionTagAttributeMap
public java.util.Map<java.lang.String,java.lang.String> getCollectionTagAttributeMap()
-
setCollectionTagAttributeMap
public void setCollectionTagAttributeMap(java.util.Map<java.lang.String,java.lang.String> collectionAttributeMap)
-
getCollectionTagAttributes
public java.lang.String getCollectionTagAttributes()
-
getItemTagName
public java.lang.String getItemTagName()
-
setItemTagName
public void setItemTagName(java.lang.String itemTagName)
-
iterator
public java.util.Iterator iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Object>
-
toXmlString
public java.lang.String toXmlString()
-
getTotal
public int getTotal()
-
-