packagecom.alibaba.excel.analysis.v03.handlers;importorg.apache.poi.hssf.record.Record;importorg.apache.poi.hssf.record.StringRecord;importorg.slf4j.Logger;importorg.slf4j.LoggerFactory;importcom.alibaba.excel.analysis.v03.IgnorableXlsRecordHandler;importcom.alibaba.excel.context.XlsReadContext;importcom.alibaba.excel.metadata.CellData;/** * Record handler * * @author Dan Zheng */publicclassStringRecordHandlerimplementsIgnorableXlsRecordHandler{privatestaticfinalLoggerLOGGER=LoggerFactory.getLogger(StringRecordHandler.class);@OverridepublicvoidprocessRecord(XlsReadContextxlsReadContext,Recordrecord){// String for formulaStringRecordsrec=(StringRecord)record;CellDatatempCellData=xlsReadContext.tempCellData();if(tempCellData==null){LOGGER.warn("String type formula but no value found.");return;}tempCellData.setStringValue(srec.getString());xlsReadContext.cellMap().put(tempCellData.getColumnIndex(),tempCellData);xlsReadContext.tempCellData(null);}}