org.gageot.excel.core
Interface SheetExtractor

All Known Implementing Classes:
RowMapperSheetExtractor

public interface SheetExtractor

Callback interface used by ExcelTemplate's query methods. Implementations of this interface perform the actual work of extracting results, but don't need to worry about exception handling. IOExceptions will be caught and handled correctly by the ExcelTemplate class.

This interface is mainly used within the ExcelTemplate framework. A RowCallbackHandler is usually a simpler choice for HSSFSheet processing.

Note: In contrast to a RowCallbackHandler, a SheetExtractor object is typically stateless and thus reusable, as long as it doesn't access stateful resources or keep result state within the object.

Author:
David Gageot
See Also:
ExcelTemplate, RowCallbackHandler

Method Summary
 java.lang.Object extractData(org.apache.poi.hssf.usermodel.HSSFSheet sheet)
          Implementations must implement this method to process all rows in the HSSFSheet.
 

Method Detail

extractData

java.lang.Object extractData(org.apache.poi.hssf.usermodel.HSSFSheet sheet)
                             throws java.io.IOException,
                                    org.springframework.dao.DataAccessException
Implementations must implement this method to process all rows in the HSSFSheet.

Parameters:
sheet - HSSFSheet to extract data from.
Returns:
an arbitrary result object, or null if none (the extractor will typically be stateful in the latter case).
Throws:
java.io.IOException - if a IOException is encountered getting column values or navigating (that is, there's no need to catch IOException)
org.springframework.dao.DataAccessException - in case of custom exceptions


Copyright © 2007 gageot.net. All Rights Reserved.