Java Doc for TableDataProvider.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » data » provider » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » visualweb.api.designer » com.sun.data.provider 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.data.provider.TableDataProvider

All known Subclasses:   com.sun.data.provider.impl.AbstractTableDataProvider,  com.sun.data.provider.impl.CachedRowSetDataProvider,  com.sun.data.provider.impl.MethodResultTableDataProvider,
TableDataProvider
public interface TableDataProvider extends DataProvider(Code)

TableDataProvider is a specialized subinterface of DataProvider that provides access to a scrollable set of "rows" of data elements, with each row being identified by a RowKey . Access to the underlying data elements may be done in a random fashion by using the methods defined in this interface, or you can set the cursor row and use the getType(), getValue(), isReadOnly(), and setValue() methods from the base DataProvider interface to access data elements for the cursor row specified by calling setCursorRow(RowKey).

The set of FieldKey s returned by getFieldKeys() MUST be available on every row supported by this TableDataProvider . This implies a rectangular (matrix) dataset.

The set of RowKey s returned by getRowKeys(...) are expected to uniquely represent the rows contained in the underlying data source. The RowKey objects should remain valid as long as the set of rows in the TableDataProvider has not been re-fetched. Once a re-fetch has happened (by whatever means are supplied by specific TableDataProvider implementations), the previously fetched RowKeys may become invalid. Consult the documentation of the specific TableDataProvider implementation for details on the expected valid lifespan of a RowKey.

Most methods throw DataProviderException , which is a generic runtime exception indicating something is amiss in the internal state of the TableDataProvider implementation. Because DPE is a runtime exception, method calls are not required to be wrapped in a try...catch block, but it is advised to check the documentation of the particular TableDataProvider implementation to see what conditions will cause a DataProviderException to be thrown. It is recommended to always wrap calls to this interface in try...catch blocks in case an unforseen error condition arises at runtime.


author:
   Joe Nuxoll
author:
   Matthew Bohm




Method Summary
public  voidaddTableCursorListener(TableCursorListener listener)
    
public  voidaddTableDataListener(TableDataListener listener)
    
public  RowKeyappendRow()
    

Appends a new row at the end of the list and returns the row key for the newly appended row.

NOTE: The method should only be called after testing the canAppendRow() method to see if this TableDataProvider supports the append operation.

The row key for the newly appended row
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException).
public  booleancanAppendRow()
    

This method is called to test if this TableDataProvider supports the append operation.

public  booleancanInsertRow(RowKey beforeRow)
    

This method is called to test if this TableDataProvider supports resizability.

public  booleancanRemoveRow(RowKey rowKey)
    

This method is called to test if this TableDataProvider supports the removeRow operation.

public  booleancursorFirst()
    

Move the cursor to the first row in this TableDataProvider.

true if the cursor row was successfully changed;else false
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning false.
public  booleancursorLast()
    

Move the cursor to the last row in this TableDataProvider.

true if the cursor row was successfully changed;else false
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning false.
public  booleancursorNext()
    

Move the cursor to the row after the current cursor row, unless the cursor is currently at the last row TableDataProvider .

true if the cursor row was successfully changed;else false
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning false.
public  booleancursorPrevious()
    

Move the cursor to the row before the current cursor row, unless the cursor is currently at the first row.

true if the cursor row was successfully changed;else false
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning false.
public  RowKeygetCursorRow()
     the RowKey of the current cursor row position
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException).
public  intgetRowCount()
     the number of rows represented by thisTableDataProvider if this information is available;otherwise, return -1 (indicating unknown row count)
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning -1.
public  RowKeygetRowKey(String rowId)
     Returns a RowKey for the specified rowId.
public  RowKey[]getRowKeys(int count, RowKey afterRow)
     Returns an array of RowKey objects representing the requested batch of RowKeys.
public  TableCursorListener[]getTableCursorListeners()
     An array of the TableCursorListeners currently registeredon this TableDataProvider.
public  TableDataListener[]getTableDataListeners()
     An array of the TableDataListeners currently registeredon this TableDataProvider.
public  ObjectgetValue(FieldKey fieldKey, RowKey rowKey)
    

Return value of the data element referenced by the specified FieldKey and RowKey .


Parameters:
  fieldKey - FieldKey identifying the data elementwhose value is to be returned
Parameters:
  rowKey - RowKey identifying the data row whose valueis to be returned value of the data element referenced by the specifiedFieldKey and RowKey
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning null.
public  RowKeyinsertRow(RowKey beforeRow)
    

Inserts a new row at the specified row.

NOTE: The method should only be called after testing the canInsertRow(RowKey beforeRow) to see if this TableDataProvider supports resizing.


Parameters:
  beforeRow - The desired location to insert the new row in front of A RowKey representing the address of the newly inserted row
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException).
public  booleanisRowAvailable(RowKey rowKey)
     Returns true if the specified RowKey represents data elements that are supported by this TableDataProvider ; otherwise, return false
Parameters:
  rowKey - RowKey specifying row to be tested true if the row is available, false ifnot
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning false.
public  voidremoveRow(RowKey rowKey)
    

Removes the specified row.

NOTE: The method should only be called after testing the canRemoveRow(RowKey) method to see if this TableDataProvider supports removing rows.


Parameters:
  rowKey - The desired row key to remove
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException).
public  voidremoveTableCursorListener(TableCursorListener listener)
    
public  voidremoveTableDataListener(TableDataListener listener)
    
public  voidsetCursorRow(RowKey rowKey)
    

Sets the cursor to the row represented by the passed RowKey .


Parameters:
  rowKey - New RowKey to move the cursor to.
throws:
  TableCursorVetoException - if a TableCursorListener decides toveto the cursor navigation
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException).
public  voidsetValue(FieldKey fieldKey, RowKey rowKey, Object value)
    

Sets the value of the data element represented by the specified FieldKey and RowKey to the specified new value.


Parameters:
  fieldKey - FieldKey identifying the data elementwhose value is to be modified
Parameters:
  rowKey - RowKey indentifying the data row whose valueis to be modified
Parameters:
  value - New value for this data element
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException).



Method Detail
addTableCursorListener
public void addTableCursorListener(TableCursorListener listener)(Code)

Register a new TableCursorListener to this TableDataProvider instance.


Parameters:
  listener - New TableCursorListener to register



addTableDataListener
public void addTableDataListener(TableDataListener listener)(Code)

Register a new TableDataListener to this TableDataProvider instance.


Parameters:
  listener - New TableDataListener to register



appendRow
public RowKey appendRow() throws DataProviderException(Code)

Appends a new row at the end of the list and returns the row key for the newly appended row.

NOTE: The method should only be called after testing the canAppendRow() method to see if this TableDataProvider supports the append operation.

The row key for the newly appended row
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException). Consultthe documentation of the specific TableDataProviderimplementation for details on what exceptions might be wrappedby a DPE.
See Also:   TableDataProvider.canAppendRow()



canAppendRow
public boolean canAppendRow() throws DataProviderException(Code)

This method is called to test if this TableDataProvider supports the append operation. If rows can be appended to the list, this method should return true. If the data provider is not resizable, or cannot support an append operation, this method should return false.

true if the data provider supports the appendoperation, or false if not.
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException). A DPEmay also indicate that this RowKey does notrepresent a row provided by this TableDataProvider. Consult thedocumentation of the specific TableDataProvider implementationfor details on what exceptions might be wrapped by a DPE.
See Also:   TableDataProvider.appendRow()



canInsertRow
public boolean canInsertRow(RowKey beforeRow) throws DataProviderException(Code)

This method is called to test if this TableDataProvider supports resizability. If objects can be inserted and removed from the list, this method should return true. If the data provider is not resizable, this method should return false.

The following methods will only be called if this method returns true:

  • insertRow(RowKey beforeRow)
  • appendRow()
  • removeRow(RowKey rowKey)

Parameters:
  beforeRow - The desired location to insert the new row in front of true if the data provider is resizable, orfalse if not.
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning false. A DPE may also indicate that thisRowKey does not represent a row provided by thisTableDataProvider. Consult the documentation of the specificTableDataProvider implementation for details on what exceptionsmight be wrapped by a DPE.
See Also:   TableDataProvider.insertRow(RowKey)



canRemoveRow
public boolean canRemoveRow(RowKey rowKey) throws DataProviderException(Code)

This method is called to test if this TableDataProvider supports the removeRow operation. If rows can be removed from the table, this method should return true. If the data provider is does not support removing rows, this method should return false.


Parameters:
  rowKey - The desired row to remove true if the data provider supports removing rows,or false if not.
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException). A DPEmay also indicate that this RowKey does notrepresent a row provided by this TableDataProvider. Consultthe documentation of the specific TableDataProviderimplementation for details on what exceptions might be wrappedby a DPE.
See Also:   TableDataProvider.removeRow(RowKey)



cursorFirst
public boolean cursorFirst() throws DataProviderException(Code)

Move the cursor to the first row in this TableDataProvider.

true if the cursor row was successfully changed;else false
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning false. Consult the documentation of thespecific TableDataProvider implementation for details on whatexceptions might be wrapped by a DPE.



cursorLast
public boolean cursorLast() throws DataProviderException(Code)

Move the cursor to the last row in this TableDataProvider.

true if the cursor row was successfully changed;else false
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning false. Consult the documentation of thespecific TableDataProvider implementation for details on whatexceptions might be wrapped by a DPE.



cursorNext
public boolean cursorNext() throws DataProviderException(Code)

Move the cursor to the row after the current cursor row, unless the cursor is currently at the last row TableDataProvider .

true if the cursor row was successfully changed;else false
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning false. Consult the documentation of thespecific TableDataProvider implementation for details on whatexceptions might be wrapped by a DPE.



cursorPrevious
public boolean cursorPrevious() throws DataProviderException(Code)

Move the cursor to the row before the current cursor row, unless the cursor is currently at the first row.

true if the cursor row was successfully changed;else false
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning false. Consult the documentation of thespecific TableDataProvider implementation for details on whatexceptions might be wrapped by a DPE.



getCursorRow
public RowKey getCursorRow() throws DataProviderException(Code)
the RowKey of the current cursor row position
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException). Consultthe documentation of the specific TableDataProviderimplementation for details on what exceptions might be wrappedby a DPE.



getRowCount
public int getRowCount() throws DataProviderException(Code)
the number of rows represented by thisTableDataProvider if this information is available;otherwise, return -1 (indicating unknown row count)
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning -1. Consult the documentation of thespecific TableDataProvider implementation for details on whatexceptions might be wrapped by a DPE.



getRowKey
public RowKey getRowKey(String rowId) throws DataProviderException(Code)
Returns a RowKey for the specified rowId. This allows a RowKey to be stored off as a simple string, which can be resolved into an instance of a RowKey at a later date.
Parameters:
  rowId - The cannoncial string ID of the desired RowKey A RowKey object representing the desired row, ornull if the specified rowId does not correspond toa row in this TableDataProvider
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning null. Consult the documentation of thespecific TableDataProvider implementation for details on whatexceptions might be wrapped by a DPE.



getRowKeys
public RowKey[] getRowKeys(int count, RowKey afterRow) throws DataProviderException(Code)
Returns an array of RowKey objects representing the requested batch of RowKeys. If null is passed as the afterRow parameter, the returned batch of RowKeys will start with the first one.
Parameters:
  count - The desired count of RowKeys to fetch. If this numberexceeds the total number of rows available, the return arraywill contain the available number, and no exception will bethrown. Consider this an optimistic request of theTableDataProvider.
Parameters:
  afterRow - The RowKey that represents the last row before the setof desired RowKeys to be returned. Typically, this is the lastRowKey from the previously fetched set of RowKeys. Ifnull is passed, the returned set will begin with thefirst row. An array of RowKey objects representing the requested batch ofrows.
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning null or an empty array. Consult thedocumentation of the specific TableDataProvider implementationfor details on what exceptions might be wrapped by a DPE.



getTableCursorListeners
public TableCursorListener[] getTableCursorListeners()(Code)
An array of the TableCursorListeners currently registeredon this TableDataProvider. If there are no registered listeners,a zero-length array is returned.



getTableDataListeners
public TableDataListener[] getTableDataListeners()(Code)
An array of the TableDataListeners currently registeredon this TableDataProvider. If there are no registered listeners,a zero-length array is returned.



getValue
public Object getValue(FieldKey fieldKey, RowKey rowKey) throws DataProviderException(Code)

Return value of the data element referenced by the specified FieldKey and RowKey .


Parameters:
  fieldKey - FieldKey identifying the data elementwhose value is to be returned
Parameters:
  rowKey - RowKey identifying the data row whose valueis to be returned value of the data element referenced by the specifiedFieldKey and RowKey
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning null. A DPE may also indicate that thisFieldKey or RowKey does not representa data element provided by this TableDataProvider. Consult thedocumentation of the specific TableDataProvider implementationfor details on what exceptions might be wrapped by a DPE.



insertRow
public RowKey insertRow(RowKey beforeRow) throws DataProviderException(Code)

Inserts a new row at the specified row.

NOTE: The method should only be called after testing the canInsertRow(RowKey beforeRow) to see if this TableDataProvider supports resizing.


Parameters:
  beforeRow - The desired location to insert the new row in front of A RowKey representing the address of the newly inserted row
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException). A DPEmay also indicate that this RowKey does notrepresent a row provided by this TableDataProvider. Consult thedocumentation of the specific TableDataProvider implementationfor details on what exceptions might be wrapped by a DPE.
See Also:   TableDataProvider.canInsertRow(RowKey)



isRowAvailable
public boolean isRowAvailable(RowKey rowKey) throws DataProviderException(Code)
Returns true if the specified RowKey represents data elements that are supported by this TableDataProvider ; otherwise, return false
Parameters:
  rowKey - RowKey specifying row to be tested true if the row is available, false ifnot
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException) ratherthan simply returning false. Consult the documentation of thespecific TableDataProvider implementation for details on whatexceptions might be wrapped by a DPE.



removeRow
public void removeRow(RowKey rowKey) throws DataProviderException(Code)

Removes the specified row.

NOTE: The method should only be called after testing the canRemoveRow(RowKey) method to see if this TableDataProvider supports removing rows.


Parameters:
  rowKey - The desired row key to remove
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException). A DPEmay also indicate that this RowKey does notrepresent a row provided by this TableDataProvider. Consultthe documentation of the specific TableDataProviderimplementation for details on what exceptions might be wrappedby a DPE.
See Also:   TableDataProvider.canRemoveRow(RowKey)



removeTableCursorListener
public void removeTableCursorListener(TableCursorListener listener)(Code)

Deregister an existing TableCursorListener from this TableDataProvider instance.


Parameters:
  listener - Old TableCursorListener to deregister



removeTableDataListener
public void removeTableDataListener(TableDataListener listener)(Code)

Deregister an existing TableDataListener from this TableDataProvider instance.


Parameters:
  listener - Old TableDataListener to deregister



setCursorRow
public void setCursorRow(RowKey rowKey) throws TableCursorVetoException(Code)

Sets the cursor to the row represented by the passed RowKey .


Parameters:
  rowKey - New RowKey to move the cursor to.
throws:
  TableCursorVetoException - if a TableCursorListener decides toveto the cursor navigation
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException). A DPEmay also indicate that this RowKey does notrepresent a row provided by this TableDataProvider. Consultthe documentation of the specific TableDataProviderimplementation for details on what exceptions might be wrappedby a DPE.



setValue
public void setValue(FieldKey fieldKey, RowKey rowKey, Object value) throws DataProviderException(Code)

Sets the value of the data element represented by the specified FieldKey and RowKey to the specified new value.


Parameters:
  fieldKey - FieldKey identifying the data elementwhose value is to be modified
Parameters:
  rowKey - RowKey indentifying the data row whose valueis to be modified
Parameters:
  value - New value for this data element
throws:
  DataProviderException - Implementations may wish to surfaceinternal exceptions (nested in DataProviderException). A DPEmay also indicate that this FieldKey orRowKey does not represent a data element providedby this TableDataProvider. Consult the documentation of thespecific TableDataProvider implementation for details on whatexceptions might be wrapped by a DPE.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.