本文整理汇总了Java中org.apache.poi.hssf.eventusermodel.HSSFRequest类的典型用法代码示例。如果您正苦于以下问题:Java HSSFRequest类的具体用法?Java HSSFRequest怎么用?Java HSSFRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HSSFRequest类属于org.apache.poi.hssf.eventusermodel包,在下文中一共展示了HSSFRequest类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.apache.poi.hssf.eventusermodel.HSSFRequest; //导入依赖的package包/类
public void execute(InputStream inputStream, IParseExcelRowMapper parseExcelRowMapper) throws IOException {
this.fs = new POIFSFileSystem(inputStream);
this.minColumns = -1;
this.parseExcelRowMapper = parseExcelRowMapper;
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(this);
formatListener = new FormatTrackingHSSFListener(listener);
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
if (outputFormulaValues) {
request.addListenerForAllRecords(formatListener);
} else {
workbookBuildingListener = new SheetRecordCollectingListener(formatListener);
request.addListenerForAllRecords(workbookBuildingListener);
}
factory.processWorkbookEvents(request, fs);
}
示例2: process
import org.apache.poi.hssf.eventusermodel.HSSFRequest; //导入依赖的package包/类
/**
* Initiates the processing of the XLS file to CSV
*/
public List<String> process() throws IOException {
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(this);
formatListener = new FormatTrackingHSSFListener(listener);
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
if (outputFormulaValues) {
request.addListenerForAllRecords(formatListener);
} else {
workbookBuildingListener = new SheetRecordCollectingListener(formatListener);
request.addListenerForAllRecords(workbookBuildingListener);
}
factory.processWorkbookEvents(request, fs);
return results;
}
示例3: process
import org.apache.poi.hssf.eventusermodel.HSSFRequest; //导入依赖的package包/类
/**
* Initiates the processing of the XLS file to CSV
* @throws java.io.IOException from upstream
*/
public void process() throws IOException {
final MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(this);
formatListener = new FormatTrackingHSSFListener(listener);
final HSSFEventFactory factory = new HSSFEventFactory();
final HSSFRequest request = new HSSFRequest();
if (outputFormulaValues) {
request.addListenerForAllRecords(formatListener);
} else {
workbookBuildingListener = new SheetRecordCollectingListener(formatListener);
request.addListenerForAllRecords(workbookBuildingListener);
}
factory.processWorkbookEvents(request, fs);
}
示例4: process
import org.apache.poi.hssf.eventusermodel.HSSFRequest; //导入依赖的package包/类
/**
* Initiates the processing of the XLS file to CSV
*/
public List<String> process() throws IOException {
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(this);
formatListener = new FormatTrackingHSSFListener(listener);
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
if(outputFormulaValues) {
request.addListenerForAllRecords(formatListener);
} else {
workbookBuildingListener = new SheetRecordCollectingListener(formatListener);
request.addListenerForAllRecords(workbookBuildingListener);
}
factory.processWorkbookEvents(request, fs);
return results;
}
示例5: process
import org.apache.poi.hssf.eventusermodel.HSSFRequest; //导入依赖的package包/类
/**
* 遍历 excel 文件
*/
public void process() throws IOException {
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(this);
formatListener = new FormatTrackingHSSFListener(listener);
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
if (outputFormulaValues) {
request.addListenerForAllRecords(formatListener);
} else {
workbookBuildingListener = new SheetRecordCollectingListener(formatListener);
request.addListenerForAllRecords(workbookBuildingListener);
}
factory.processWorkbookEvents(request, fs);
}
示例6: process
import org.apache.poi.hssf.eventusermodel.HSSFRequest; //导入依赖的package包/类
/**
* 遍历 excel 文件
*/
protected void process() throws IOException {
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(
this);
formatListener = new ExcelFormatTrackingHSSFListener(listener);
formatListener.ignoreNumFormat(ignoreNumFormat);
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
if (outputFormulaValues) {
request.addListenerForAllRecords(formatListener);
} else {
workbookBuildingListener = new SheetRecordCollectingListener(
formatListener);
request.addListenerForAllRecords(workbookBuildingListener);
}
factory.processWorkbookEvents(request, fs);
}
示例7: process
import org.apache.poi.hssf.eventusermodel.HSSFRequest; //导入依赖的package包/类
/**
* 遍历 excel 文件
*/
public void process() throws IOException {
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(
this);
formatListener = new FormatTrackingHSSFListener(listener);
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
if (outputFormulaValues) {
request.addListenerForAllRecords(formatListener);
} else {
workbookBuildingListener = new SheetRecordCollectingListener(
formatListener);
request.addListenerForAllRecords(workbookBuildingListener);
}
factory.processWorkbookEvents(request, fs);
}
示例8: processarArquivoIO
import org.apache.poi.hssf.eventusermodel.HSSFRequest; //导入依赖的package包/类
/**
* L� arquivo enviado e gera mensagens JMS.
*
* Instancia request e starta leitura do arquivo com esta inst�ncia (this) de
* objeto como listener
*
* @param inputStream
* @throws IOException
*
*/
protected void processarArquivoIO(InputStream inputStream) throws IOException {
POIFSFileSystem poifs = new POIFSFileSystem(inputStream);
InputStream din = poifs.createDocumentInputStream("Workbook");
try {
HSSFRequest req = new HSSFRequest();
req.addListenerForAllRecords(this);
HSSFEventFactory factory = new HSSFEventFactory();
factory.processEvents(req, din);
}catch(Throwable t){
log.fatal("Erro fatal ao tentar executar o Processamento das mensagens!",t);
t.printStackTrace();
}
finally {
inputStream.close();
din.close();
}
}
示例9: process
import org.apache.poi.hssf.eventusermodel.HSSFRequest; //导入依赖的package包/类
/**
* Initiates the processing of the XLS file to CSV
*/
public void process() throws IOException {
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(this);
formatListener = new FormatTrackingHSSFListener(listener);
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
if(outputFormulaValues) {
request.addListenerForAllRecords(formatListener);
} else {
workbookBuildingListener = new SheetRecordCollectingListener(formatListener);
request.addListenerForAllRecords(workbookBuildingListener);
}
factory.processWorkbookEvents(request, fs);
}
示例10: process
import org.apache.poi.hssf.eventusermodel.HSSFRequest; //导入依赖的package包/类
public void process(InputStream stream) throws IOException {
this.fs = new POIFSFileSystem(stream);
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(this);
formatListener = new FormatTrackingHSSFListener(listener);
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
if (outputFormulaValues) {
request.addListenerForAllRecords(formatListener);
} else {
workbookBuildingListener = new SheetRecordCollectingListener(formatListener);
request.addListenerForAllRecords(workbookBuildingListener);
}
factory.processWorkbookEvents(request, fs);
}
示例11: processFile
import org.apache.poi.hssf.eventusermodel.HSSFRequest; //导入依赖的package包/类
private void processFile() {
HSSFRequest req = new HSSFRequest();
for(short rId : getInterestingReqordIds())
req.addListener(this, rId);
HSSFEventFactory factory = new HSSFEventFactory();
factory.processEvents(req, din);
}