org.apache.commons.dbutils.handlers
Class AbstractListHandler<T>

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

public abstract class AbstractListHandler<T>
extends java.lang.Object
implements ResultSetHandler<java.util.List<T>>

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

See Also:
ResultSetHandler

Constructor Summary
AbstractListHandler()
           
 
Method Summary
 java.util.List<T> handle(java.sql.ResultSet rs)
          Whole ResultSet handler.
protected abstract  T 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

AbstractListHandler

public AbstractListHandler()
Method Detail

handle

public java.util.List<T> 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<java.util.List<T>>
Parameters:
rs - ResultSet to process.
Returns:
a list of all rows in the result set
Throws:
java.sql.SQLException - error occurs
See Also:
handleRow(ResultSet)

handleRow

protected abstract T 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


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