You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2011/11/17 18:06:56 UTC
svn commit: r1203272 -
/myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/DataModel.java
Author: lu4242
Date: Thu Nov 17 17:06:55 2011
New Revision: 1203272
URL: http://svn.apache.org/viewvc?rev=1203272&view=rev
Log:
removeDataModelListener does not reset cachedArrayListener in DataModel (already fixed on 2.0.x but not committed on 1.2.x)
Modified:
myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/DataModel.java
Modified: myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/DataModel.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/DataModel.java?rev=1203272&r1=1203271&r2=1203272&view=diff
==============================================================================
--- myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/DataModel.java (original)
+++ myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/DataModel.java Thu Nov 17 17:06:55 2011
@@ -81,12 +81,17 @@ public abstract class DataModel
}
/**
+ * <p>
* Return the number of rows of data available.
+ * </p>
* <p>
* If the number of rows of data available is not known then -1 is returned.
* This may happen for DataModels that wrap sources of data such as
* java.sql.ResultSet that provide an iterator to access the "next item"
* rather than a fixed-size collection of data.
+ * </p>
+ *
+ * @return the number of rows available.
*/
abstract public int getRowCount();
@@ -95,7 +100,8 @@ public abstract class DataModel
* <p>
* Method isRowAvailable may be called before attempting to access
* this method, to ensure that the data is available.
- *
+ *
+ * @return The object associated with the current row index.
* @throws RuntimeException subclass of some kind if the current row index
* is not within the range of the current wrappedData property.
*/
@@ -103,6 +109,7 @@ public abstract class DataModel
/**
* Get the current row index.
+ * @return The current row index.
*/
abstract public int getRowIndex();
@@ -111,12 +118,15 @@ public abstract class DataModel
* the actual type of the returned object depends upon the concrete
* subclass of DataModel; the object will represent an "ordered sequence
* of components", but may be implemented as an array, java.util.List,
- * java.sql.ResultSet or other similar types.
+ * java.sql.ResultSet or other similar types.
+ *
+ * @return the wrapped object.
*/
abstract public Object getWrappedData();
/**
* Returns true if a call to getRowData will return a valid object.
+ * @return true if a call to getRowData will return a valid object. false otherwise.
*/
abstract public boolean isRowAvailable();
@@ -127,14 +137,15 @@ public abstract class DataModel
{
_listeners.remove(listener);
}
+ _cachedListenersArray = null;
}
/**
* Set the current row index. This affects the behaviour of the
* getRowData method in particular.
*
- * Parameter rowIndex may be -1 to indicate "no row", or may be a value
- * between 0 and getRowCount()-1.
+ * @param rowIndex The row index. It may be -1 to indicate "no row",
+ * or may be a value between 0 and getRowCount()-1.
*/
abstract public void setRowIndex(int rowIndex);
@@ -142,6 +153,8 @@ public abstract class DataModel
* Set the entire list of data associated with this component. Note that
* the actual type of the provided object must match the expectations
* of the concrete subclass of DataModel. See getWrappedData.
+ *
+ * @param data The object to be wrapped.
*/
abstract public void setWrappedData(Object data);
}