public class SheetRidReader extends DefaultHandler
<sheet name="Sheet6" sheetId="4" r:id="rId6"/>
读取结果为:
{"4": "6"}
Constructor and Description |
---|
SheetRidReader() |
Modifier and Type | Method and Description |
---|---|
Integer |
getRidByIndex(int index)
通过sheet的序号获取rid
|
Integer |
getRidByIndexBase0(int index)
通过sheet的序号获取rid
|
Integer |
getRidByName(String sheetName)
根据sheet name获取rid,从1开始
|
Integer |
getRidByNameBase0(String sheetName)
根据sheet name获取rid,从0开始
|
Integer |
getRidBySheetId(int sheetId)
根据sheetId获取rid,从1开始
|
Integer |
getRidBySheetIdBase0(int sheetId)
根据sheetId获取rid,从0开始
|
List<String> |
getSheetNames()
获取所有sheet名称
|
static SheetRidReader |
parse(org.apache.poi.xssf.eventusermodel.XSSFReader reader)
从
XSSFReader 中解析sheet名、sheet id等相关信息 |
SheetRidReader |
read(org.apache.poi.xssf.eventusermodel.XSSFReader xssfReader)
读取Wordkbook的XML中sheet标签中sheetId和rid的对应关系
|
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes) |
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
public static SheetRidReader parse(org.apache.poi.xssf.eventusermodel.XSSFReader reader)
XSSFReader
中解析sheet名、sheet id等相关信息reader
- XSSFReader
public SheetRidReader read(org.apache.poi.xssf.eventusermodel.XSSFReader xssfReader)
xssfReader
- XSSF读取器public Integer getRidBySheetId(int sheetId)
sheetId
- Sheet的ID,从1开始public Integer getRidBySheetIdBase0(int sheetId)
sheetId
- Sheet的ID,从0开始public Integer getRidByName(String sheetName)
sheetName
- Sheet的namepublic Integer getRidByNameBase0(String sheetName)
sheetName
- Sheet的namepublic Integer getRidByIndex(int index)
index
- 序号,从0开始public Integer getRidByIndexBase0(int index)
index
- 序号,从0开始public void startElement(String uri, String localName, String qName, Attributes attributes)
startElement
in interface ContentHandler
startElement
in class DefaultHandler
Copyright © 2024. All rights reserved.