org.apache.commons.dbutils.handlers
Class GenericListHandler

java.lang.Object
  extended by org.apache.commons.dbutils.handlers.GenericListHandler
All Implemented Interfaces:
ResultSetHandler
Direct Known Subclasses:
ArrayListHandler, BeanListHandler, ColumnListHandler, MapListHandler

abstract class GenericListHandler
extends java.lang.Object
implements ResultSetHandler

Abstract class that simplify development of ResultSetHandler classes that convert ResultSet into List.

See Also:
ResultSetHandler

Constructor Summary
GenericListHandler()
           
 
Method Summary
 java.lang.Object handle(java.sql.ResultSet rs)
          Whole ResultSet handler.
protected abstract  java.lang.Object handleRow(java.sql.ResultSet rs)
          Row handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericListHandler

GenericListHandler()
Method Detail

handle

public java.lang.Object handle(java.sql.ResultSet rs)
                        throws java.sql.SQLException
Whole ResultSet handler. It produce List as result. To convert individual rows into Java objects it uses handleRow(ResultSet) method.

Specified by:
handle in interface ResultSetHandler
Parameters:
rs - The ResultSet to handle. It has not been touched before being passed to this method.
Returns:
An Object initialized with ResultSet data. It is legal for implementations to return null if the ResultSet contained 0 rows.
Throws:
java.sql.SQLException - if a database access error occurs
See Also:
handleRow(ResultSet)

handleRow

protected abstract java.lang.Object handleRow(java.sql.ResultSet rs)
                                       throws java.sql.SQLException
Row handler. Method converts current row into some Java object.

Parameters:
rs - ResultSet to process.
Returns:
row processing result
Throws:
java.sql.SQLException - error occurs