/*
* @see com.common.platform.excel.parser.ExcelDataParser#parser(java.lang.String)
*/
@Override
public void parser(String fileName) throws Throwable {
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
// 建立监听器
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(this);
formatListener = new FormatTrackingHSSFListener(listener);
if (outputFormulaValues) {
request.addListenerForAllRecords(formatListener);
} else {
workbookBuildingListener = new SheetRecordCollectingListener(formatListener);
request.addListenerForAllRecords(workbookBuildingListener);
}
// 解析文件并处理监听请求
POIFSFileSystem poiFile = new POIFSFileSystem(new FileInputStream(fileName));
factory.processWorkbookEvents(request, poiFile);
}