Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.0.1-core
-
None
-
environment independent.
Description
Add RowLimitMutator interface for cases where row limit can be mutated.
package org.apache.myfaces.trinidad.model;
/**
- Identifies a collection whose row limit can be mutated.
*/
public interface RowLimitMutator
{
/** - Mutate the row limit of this collection, it returns the old row limit.
- @param newLimit the new limit of this collection to set to.
- A positive number: the maximum number of rows the collection can hold.
- CollectionModel.UNKNOWN_ROW_LIMIT: row limit is unknown.
- CollectionModel.UNLIMITED_ROW: there is no limit
- @returns the old row limit.
- @throws IllegalArgumentException if <em>newLimit</em> is 0 or any negative number
- other than CollectionModel.UNKNOWN_ROW_LIMIT and CollectionModel.UNLIMITED_ROW.
*/
public int setRowLimit(int newLimit);
}
CollectionModel is updated to define the row limit constants, and also provides the default implementation of retrieving row limit method.
/**
- Gets the row limit of this collection model. Default is to return UNKNOWN_ROW_LIMIT.
- Subclasses should override this method if row limit is enforced.
- @return the maximum number of rows this collection can hold, possible return values are:
- A positive number: the maximum number of rows the collection can hold
- UNKNOWN_ROW_LIMIT: row limit is unknown.
- UNLIMITED_ROW: there is no limit
*/
public int getRowLimit() { return UNKNOWN_ROW_LIMIT; }
public final static int UNLIMITED_ROW = -2;
public final static int UNKNOWN_ROW_LIMIT = -1;