org.apache.commons.dbutils.handlers
Class AbstractListHandler

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

public abstract class AbstractListHandler
extends Object
implements ResultSetHandler

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

See Also:
ResultSetHandler

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

Constructor Detail

AbstractListHandler

public AbstractListHandler()
Method Detail

handle

public Object handle(ResultSet rs)
              throws 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:
SQLException - if a database access error occurs
See Also:
handleRow(ResultSet)

handleRow

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

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


Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.