org.apache.commons.dbutils.handlers
Class MapListHandler

java.lang.Object
  extended byorg.apache.commons.dbutils.handlers.MapListHandler
All Implemented Interfaces:
ResultSetHandler

public class MapListHandler
extends Object
implements ResultSetHandler

ResultSetHandler implementation that converts a ResultSet into a List of Maps. This class is thread safe.

Author:
David Graham
See Also:
ResultSetHandler

Field Summary
private  RowProcessor convert
          The RowProcessor implementation to use when converting rows into Maps.
 
Constructor Summary
MapListHandler()
          Creates a new instance of MapListHandler using a BasicRowProcessor for conversion.
MapListHandler(RowProcessor convert)
          Creates a new instance of MapListHandler.
 
Method Summary
 Object handle(ResultSet rs)
          Converts the ResultSet rows into a List of Map objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

convert

private RowProcessor convert
The RowProcessor implementation to use when converting rows into Maps.

Constructor Detail

MapListHandler

public MapListHandler()
Creates a new instance of MapListHandler using a BasicRowProcessor for conversion.


MapListHandler

public MapListHandler(RowProcessor convert)
Creates a new instance of MapListHandler.

Parameters:
convert - The RowProcessor implementation to use when converting rows into Maps.
Method Detail

handle

public Object handle(ResultSet rs)
              throws SQLException
Converts the ResultSet rows into a List of Map objects.

Specified by:
handle in interface ResultSetHandler
Parameters:
rs - The ResultSet to handle. It has not been touched before being passed to this method.
Returns:
A List of Maps, never null.
Throws:
SQLException
See Also:
ResultSetHandler.handle(java.sql.ResultSet)