Java ApachePOI和CellType

Java ApachePOI和CellType,java,apache-poi,apache-poi-4,Java,Apache Poi,Apache Poi 4,我对这个版本有点迷茫 <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> 或 我无法获得没有弃用或类型错误的代码:-( 我正在将Eclipe与Maven和Java 11一起使用。在版本发布后,我执行了“更新项目”来更新Maven。在ApachePOI3.17中。getCellType返回int,但不推荐使用。Cell.getCellTypeEnum返回CellT

我对这个版本有点迷茫

<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>

我无法获得没有弃用或类型错误的代码:-(


我正在将Eclipe与Maven和Java 11一起使用。在版本发布后,我执行了“更新项目”来更新Maven。

ApachePOI3.17
中。getCellType
返回
int
,但不推荐使用。
Cell.getCellTypeEnum
返回
CellType
。请参阅

因此,使用ApachePOI3.17必须

if (cell.getCellTypeEnum() == CellType.NUMERIC)
if (cell.getCellType() == CellType.NUMERIC)
apache poi
大于或等于版本
4.0.0
单元格中。getCellType
返回
CellType
单元格。getCellTypeEnum也返回
CellType
但已弃用。请参阅

因此,使用
apachepoi
大于或等于版本
4.0.0
必须

if (cell.getCellTypeEnum() == CellType.NUMERIC)
if (cell.getCellType() == CellType.NUMERIC)

apache poi 3.17
Cell.getCellType
返回
int
但已被弃用。
Cell.getCellTypeEnum
返回
CellType
。请参阅

因此,使用ApachePOI3.17必须

if (cell.getCellTypeEnum() == CellType.NUMERIC)
if (cell.getCellType() == CellType.NUMERIC)
apache poi
大于或等于版本
4.0.0
单元格中。getCellType
返回
CellType
单元格。getCellTypeEnum也返回
CellType
但已弃用。请参阅

因此,使用
apachepoi
大于或等于版本
4.0.0
必须

if (cell.getCellTypeEnum() == CellType.NUMERIC)
if (cell.getCellType() == CellType.NUMERIC)

我尝试过,但Eclipse不接受删除不赞成的内容。@chris01:然后Eclipse做了一些错误的事情。或者您在一个项目中混合了不同的
apache poi
版本。我尝试过,但Eclipse不接受删除不赞成的内容。@chris01:然后Eclipse做了一些错误的事情。或者您混合了不同的
apache poi
一个项目中的版本。