datamodel.html

来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 537 行 · 第 1/2 页

HTML
537
字号
<A NAME="DataModel()"><!-- --></A><H3>DataModel</H3><PRE>public <B>DataModel</B>()</PRE><DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="isRowAvailable()"><!-- --></A><H3>isRowAvailable</H3><PRE>public abstract boolean <B>isRowAvailable</B>()</PRE><DL><DD><p>Return a flag indicating whether there is <code>rowData</code> available at the current <code>rowIndex</code>.  If no <code>wrappedData</code> is available, return <code>false</code>.</p><P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if an error occurs getting the row availability</DL></DD></DL><HR><A NAME="getRowCount()"><!-- --></A><H3>getRowCount</H3><PRE>public abstract int <B>getRowCount</B>()</PRE><DL><DD><p>Return the number of rows of data objects represented by this <A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model"><CODE>DataModel</CODE></A>.  If the number of rows is unknown, or no <code>wrappedData</code> is available, return -1.</p><P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if an error occurs getting the row count</DL></DD></DL><HR><A NAME="getRowData()"><!-- --></A><H3>getRowData</H3><PRE>public abstract <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getRowData</B>()</PRE><DL><DD><p>Return an object representing the data for the currenty selected row index.  If no <code>wrappedData</code> is available, return <code>null</code>.</p><P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if an error occurs getting the row data<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if now row data is available  at the currently specified row index</DL></DD></DL><HR><A NAME="getRowIndex()"><!-- --></A><H3>getRowIndex</H3><PRE>public abstract int <B>getRowIndex</B>()</PRE><DL><DD><p>Return the zero-relative index of the currently selected row.  If we are not currently positioned on a row, or no <code>wrappedData</code> is available, return -1.</p><P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if an error occurs getting the row index</DL></DD></DL><HR><A NAME="setRowIndex(int)"><!-- --></A><H3>setRowIndex</H3><PRE>public abstract void <B>setRowIndex</B>(int&nbsp;rowIndex)</PRE><DL><DD><p>Set the zero-relative index of the currently selected row, or -1 to indicate that we are not positioned on a row.  It is possible to set the row index at a value for which the underlying data collection does not contain any row data.  Therefore, callers may use the <code>isRowAvailable()</code> method to detect whether row data will be available for use by the <code>getRowData()</code> method.</p> <p>If there is no <code>wrappedData</code> available when this method is called, the specified <code>rowIndex</code> is stored (and may be retrieved by a subsequent call to <code>getRowData()</code>), but no event is sent.  Otherwise, if the currently selected row index is changed by this call, a <A HREF="../../../javax/faces/model/DataModelEvent.html" title="class in javax.faces.model"><CODE>DataModelEvent</CODE></A> will be sent to the <code>rowSelected()</code> method of all registered <A HREF="../../../javax/faces/model/DataModelListener.html" title="interface in javax.faces.model"><CODE>DataModelListener</CODE></A>s.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>rowIndex</CODE> - The new zero-relative index (must be non-negative)<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/faces/FacesException.html" title="class in javax.faces">FacesException</A></CODE> - if an error occurs setting the row index<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if <code>rowIndex</code>  is less than -1</DL></DD></DL><HR><A NAME="getWrappedData()"><!-- --></A><H3>getWrappedData</H3><PRE>public abstract <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getWrappedData</B>()</PRE><DL><DD><p>Return the object representing the data wrapped by this <A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model"><CODE>DataModel</CODE></A>, if any.</p><P><DD><DL></DL></DD></DL><HR><A NAME="setWrappedData(java.lang.Object)"><!-- --></A><H3>setWrappedData</H3><PRE>public abstract void <B>setWrappedData</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;data)</PRE><DL><DD><p>Set the object representing the data collection wrapped by this <A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model"><CODE>DataModel</CODE></A>.  If the specified <code>data</code> is <code>null</code>, detach this <A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model"><CODE>DataModel</CODE></A> from any previously wrapped data collection instead.</p> <p>If <code>data</code> is non-<code>null</code>, the currently selected row index must be set to zero, and a <A HREF="../../../javax/faces/model/DataModelEvent.html" title="class in javax.faces.model"><CODE>DataModelEvent</CODE></A> must be sent to the <code>rowSelected()</code> method of all registered <A HREF="../../../javax/faces/model/DataModelListener.html" title="interface in javax.faces.model"><CODE>DataModelListener</CODE></A>s indicating that this row is now selected.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - Data collection to be wrapped, or <code>null</code> to  detach from any previous data collection<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/ClassCastException.html" title="class or interface in java.lang">ClassCastException</A></CODE> - if <code>data</code> is not of the  appropriate type for this <A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model"><CODE>DataModel</CODE></A> implementation</DL></DD></DL><HR><A NAME="addDataModelListener(javax.faces.model.DataModelListener)"><!-- --></A><H3>addDataModelListener</H3><PRE>public void <B>addDataModelListener</B>(<A HREF="../../../javax/faces/model/DataModelListener.html" title="interface in javax.faces.model">DataModelListener</A>&nbsp;listener)</PRE><DL><DD><p>Add a new <A HREF="../../../javax/faces/model/DataModelListener.html" title="interface in javax.faces.model"><CODE>DataModelListener</CODE></A> to the set interested in notifications from this <A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model"><CODE>DataModel</CODE></A>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - The new <A HREF="../../../javax/faces/model/DataModelListener.html" title="interface in javax.faces.model"><CODE>DataModelListener</CODE></A> to be registered<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>listener</code>  is <code>null</code></DL></DD></DL><HR><A NAME="getDataModelListeners()"><!-- --></A><H3>getDataModelListeners</H3><PRE>public <A HREF="../../../javax/faces/model/DataModelListener.html" title="interface in javax.faces.model">DataModelListener</A>[] <B>getDataModelListeners</B>()</PRE><DL><DD><p>Return the set of <A HREF="../../../javax/faces/model/DataModelListener.html" title="interface in javax.faces.model"><CODE>DataModelListener</CODE></A>s interested in notifications from this <A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model"><CODE>DataModel</CODE></A>.  If there are no such listeners, an empty array is returned.</p><P><DD><DL></DL></DD></DL><HR><A NAME="removeDataModelListener(javax.faces.model.DataModelListener)"><!-- --></A><H3>removeDataModelListener</H3><PRE>public void <B>removeDataModelListener</B>(<A HREF="../../../javax/faces/model/DataModelListener.html" title="interface in javax.faces.model">DataModelListener</A>&nbsp;listener)</PRE><DL><DD><p>Remove an existing <A HREF="../../../javax/faces/model/DataModelListener.html" title="interface in javax.faces.model"><CODE>DataModelListener</CODE></A> from the set interested in notifications from this <A HREF="../../../javax/faces/model/DataModel.html" title="class in javax.faces.model"><CODE>DataModel</CODE></A>.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - The old <A HREF="../../../javax/faces/model/DataModelListener.html" title="interface in javax.faces.model"><CODE>DataModelListener</CODE></A> to be deregistered<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>listener</code>  is <code>null</code></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../javax/faces/model/ArrayDataModel.html" title="class in javax.faces.model"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../javax/faces/model/DataModelEvent.html" title="class in javax.faces.model"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html?javax/faces/model/DataModel.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="DataModel.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?