Class SAXSheetHandler
java.lang.Object
com.github.cla9.excel.reader.sheet.AbstractSheetHandler
com.github.cla9.excel.reader.sheet.SAXSheetHandler
- All Implemented Interfaces:
SheetHandler,org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler
- Direct Known Subclasses:
SAXSheetExcelColumnHandler
public class SAXSheetHandler extends AbstractSheetHandler implements SheetHandler, org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler
The type Sax sheet handler.
-
Field Summary
Fields Modifier and Type Field Description protected intcurrentColThe Current col.protected intcurrentRowThe Current row.protected RangedataRangeThe Data range.protected RangeheaderRangeThe Header range.protected java.util.List<MergedArea>mergedAreasThe Merged areas.protected java.util.List<java.lang.String>rowThe Row.protected java.util.function.Consumer<java.util.List<java.lang.String>>rowGenerationSuccessCallbackThe Row generation success callback.Fields inherited from class com.github.cla9.excel.reader.sheet.AbstractSheetHandler
excelMetaModel, headerNames, order, sheetName -
Constructor Summary
Constructors Constructor Description SAXSheetHandler(ExcelMetaModel excelMetaModel, java.util.List<MergedArea> mergedAreas)Instantiates a new Sax sheet handler. -
Method Summary
Modifier and Type Method Description voidcell(java.lang.String cellReference, java.lang.String formattedValue, org.apache.poi.xssf.usermodel.XSSFComment comment)protected voidcreateEmptyCell(int gap)Create empty cell.voidendRow(int rowNum)java.util.List<java.lang.String>getHeaderNames()Gets header names.int[]getOrder()Get order int [ ].protected booleanisPass()Is pass boolean.voidsetRowGenerationSuccessCallback(java.util.function.Consumer<java.util.List<java.lang.String>> rowGenerationSuccessCallback)Sets row generation success callback.voidstartRow(int rowNum)Methods inherited from class com.github.cla9.excel.reader.sheet.AbstractSheetHandler
createOrder, reOrderHeaderName, validateHeader, validateOrder
-
Field Details
-
currentRow
protected int currentRowThe Current row. -
mergedAreas
The Merged areas. -
row
protected java.util.List<java.lang.String> rowThe Row. -
currentCol
protected int currentColThe Current col. -
dataRange
The Data range. -
headerRange
The Header range. -
rowGenerationSuccessCallback
protected java.util.function.Consumer<java.util.List<java.lang.String>> rowGenerationSuccessCallbackThe Row generation success callback.
-
-
Constructor Details
-
SAXSheetHandler
Instantiates a new Sax sheet handler.- Parameters:
excelMetaModel- the excel meta modelmergedAreas- the merged areas
-
-
Method Details
-
setRowGenerationSuccessCallback
public void setRowGenerationSuccessCallback(java.util.function.Consumer<java.util.List<java.lang.String>> rowGenerationSuccessCallback)Sets row generation success callback.- Parameters:
rowGenerationSuccessCallback- the row generation success callback
-
startRow
public void startRow(int rowNum)- Specified by:
startRowin interfaceorg.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler
-
endRow
public void endRow(int rowNum)- Specified by:
endRowin interfaceorg.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler
-
cell
public void cell(java.lang.String cellReference, java.lang.String formattedValue, org.apache.poi.xssf.usermodel.XSSFComment comment)- Specified by:
cellin interfaceorg.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler
-
createEmptyCell
protected void createEmptyCell(int gap)Create empty cell.- Parameters:
gap- the gap
-
getHeaderNames
public java.util.List<java.lang.String> getHeaderNames()Description copied from interface:SheetHandlerGets header names.- Specified by:
getHeaderNamesin interfaceSheetHandler- Overrides:
getHeaderNamesin classAbstractSheetHandler- Returns:
- the header names
-
getOrder
public int[] getOrder()Description copied from interface:SheetHandlerGet order int [ ].- Specified by:
getOrderin interfaceSheetHandler- Overrides:
getOrderin classAbstractSheetHandler- Returns:
- the int [ ]
-
isPass
protected boolean isPass()Is pass boolean.- Returns:
- the boolean
-