|
|
@ -26,33 +26,41 @@ import org.xml.sax.helpers.DefaultHandler; |
|
|
|
@Slf4j |
|
|
|
@Slf4j |
|
|
|
public class XlsxRowHandler extends DefaultHandler { |
|
|
|
public class XlsxRowHandler extends DefaultHandler { |
|
|
|
private final XlsxReadContext xlsxReadContext; |
|
|
|
private final XlsxReadContext xlsxReadContext; |
|
|
|
private static final Map<String, XlsxTagHandler> XLSX_CELL_HANDLER_MAP = new HashMap<String, XlsxTagHandler>(32); |
|
|
|
private static final Map<String, XlsxTagHandler> XLSX_CELL_HANDLER_MAP = new HashMap<>(64); |
|
|
|
|
|
|
|
|
|
|
|
static { |
|
|
|
static { |
|
|
|
CellFormulaTagHandler cellFormulaTagHandler = new CellFormulaTagHandler(); |
|
|
|
CellFormulaTagHandler cellFormulaTagHandler = new CellFormulaTagHandler(); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.CELL_FORMULA_TAG, cellFormulaTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.CELL_FORMULA_TAG, cellFormulaTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_CELL_FORMULA_TAG, cellFormulaTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_CELL_FORMULA_TAG, cellFormulaTagHandler); |
|
|
|
|
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.NS2_CELL_FORMULA_TAG, cellFormulaTagHandler); |
|
|
|
CellInlineStringValueTagHandler cellInlineStringValueTagHandler = new CellInlineStringValueTagHandler(); |
|
|
|
CellInlineStringValueTagHandler cellInlineStringValueTagHandler = new CellInlineStringValueTagHandler(); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.CELL_INLINE_STRING_VALUE_TAG, cellInlineStringValueTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.CELL_INLINE_STRING_VALUE_TAG, cellInlineStringValueTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_CELL_INLINE_STRING_VALUE_TAG, cellInlineStringValueTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_CELL_INLINE_STRING_VALUE_TAG, cellInlineStringValueTagHandler); |
|
|
|
|
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.NS2_CELL_INLINE_STRING_VALUE_TAG, cellInlineStringValueTagHandler); |
|
|
|
CellTagHandler cellTagHandler = new CellTagHandler(); |
|
|
|
CellTagHandler cellTagHandler = new CellTagHandler(); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.CELL_TAG, cellTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.CELL_TAG, cellTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_CELL_TAG, cellTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_CELL_TAG, cellTagHandler); |
|
|
|
|
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.NS2_CELL_TAG, cellTagHandler); |
|
|
|
CellValueTagHandler cellValueTagHandler = new CellValueTagHandler(); |
|
|
|
CellValueTagHandler cellValueTagHandler = new CellValueTagHandler(); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.CELL_VALUE_TAG, cellValueTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.CELL_VALUE_TAG, cellValueTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_CELL_VALUE_TAG, cellValueTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_CELL_VALUE_TAG, cellValueTagHandler); |
|
|
|
|
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.NS2_CELL_VALUE_TAG, cellValueTagHandler); |
|
|
|
CountTagHandler countTagHandler = new CountTagHandler(); |
|
|
|
CountTagHandler countTagHandler = new CountTagHandler(); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.DIMENSION_TAG, countTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.DIMENSION_TAG, countTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_DIMENSION_TAG, countTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_DIMENSION_TAG, countTagHandler); |
|
|
|
|
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.NS2_DIMENSION_TAG, countTagHandler); |
|
|
|
HyperlinkTagHandler hyperlinkTagHandler = new HyperlinkTagHandler(); |
|
|
|
HyperlinkTagHandler hyperlinkTagHandler = new HyperlinkTagHandler(); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.HYPERLINK_TAG, hyperlinkTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.HYPERLINK_TAG, hyperlinkTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_HYPERLINK_TAG, hyperlinkTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_HYPERLINK_TAG, hyperlinkTagHandler); |
|
|
|
|
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.NS2_HYPERLINK_TAG, hyperlinkTagHandler); |
|
|
|
MergeCellTagHandler mergeCellTagHandler = new MergeCellTagHandler(); |
|
|
|
MergeCellTagHandler mergeCellTagHandler = new MergeCellTagHandler(); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.MERGE_CELL_TAG, mergeCellTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.MERGE_CELL_TAG, mergeCellTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_MERGE_CELL_TAG, mergeCellTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_MERGE_CELL_TAG, mergeCellTagHandler); |
|
|
|
|
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.NS2_MERGE_CELL_TAG, mergeCellTagHandler); |
|
|
|
RowTagHandler rowTagHandler = new RowTagHandler(); |
|
|
|
RowTagHandler rowTagHandler = new RowTagHandler(); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.ROW_TAG, rowTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.ROW_TAG, rowTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_ROW_TAG, rowTagHandler); |
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.X_ROW_TAG, rowTagHandler); |
|
|
|
|
|
|
|
XLSX_CELL_HANDLER_MAP.put(ExcelXmlConstants.NS2_ROW_TAG, rowTagHandler); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public XlsxRowHandler(XlsxReadContext xlsxReadContext) { |
|
|
|
public XlsxRowHandler(XlsxReadContext xlsxReadContext) { |
|
|
|