Alternative to deprecated getCellType

后端 未结 8 2253
自闭症患者
自闭症患者 2020-11-27 05:44

I\'m reading an excel-file (file extension xlsx) using org.apache.poi 3.15.

This is my code:

try (FileInputStream fileInputStream = new FileInputStr         


        
相关标签:
8条回答
  • 2020-11-27 06:17

    It looks that 3.15 offers no satisfying solution: either one uses the old style with Cell.CELL_TYPE_*, or we use the method getCellTypeEnum() which is marked as deprecated. A lot of disturbances for little add value...

    0 讨论(0)
  • 2020-11-27 06:19

    Use getCellType()

    switch (cell.getCellType()) {
       case BOOLEAN :
                     //To-do
                     break;
       case NUMERIC:
                     //To-do
                     break;
       case STRING:
                     //To-do
                     break;
    }
    
    0 讨论(0)
提交回复
热议问题