在Excel文件中获取单元格的超链接

我正试图使用​​这个Excel文件中的单元格的超链接和标签
库(这个库是基于apache POI的)

https://github.com/monitorjbl/excel-streaming-reader#supported-methods

我试过这个

InputStream is = new FileInputStream("file"); Workbook workbook = StreamingReader.builder().rowCacheSize(100) .bufferSize(4096) .open(is); Iterator<Row> rowIterator=workbook.getSheetAt(0).iterator(); Row row=rowIterator.next(); Iterator<Cell> cellIterator = row.cellIterator(); Cell currentCell = cellIterator.next(); String parthyperlink=currentCell.getHyperlink().getAddress(); String label=currentCell.getHyperlink().getLabel(); 

但我得到这个例外

com.monitorjbl.xlsx.exceptions.NotSupportedException at com.monitorjbl.xlsx.impl.StreamingCell.getHyperlink(StreamingCell.java:353)at com.z2data.mapping.ExeclHorizental.getCurrentRow(ExeclHorizental.java:88)

超链接不是一个string。 实例化一个超链接。 尝试这个:

 Hyperlink h = currentCell.getHyperlink(); 

然后您可以获取特定单元格的地址

 if (h == null) { System.err.println("Cell didn't have a hyperlink!"); } else { System.out.println("Cell : " + h.getLabel() + " -> " + h.getAddress()); }