title: alternate for getcelltype in poi 3.17 other than getCellTypeEnum()
body: <p>I am reading one excel file and converting it to a XML file using apache poi 3.17. I am using getCelltype for getting the CELLTYPE of the current Cell. But I am getting "<code>getCellType()</code> is depreciated". I searched for other questions but what I found that I should use "<code>CellType    getCellTypeEnum()</code>". But that is also showing the same warning. I searched in the Apache POI documentation but its written that <code>"getCellTypeEnum()"</code> is depreciated and "<em>use <code>getCellType</code> instead</em>". I can't understand what should I use to remove the warning. If anyone can help what are other alternatives for <code>getCellType()</code> that are usable in this context.</p>
  
  <pre><code>try {
              log.info("Getting the path for Input Excel File");
             // String excelPath = "D:\\Tools\\BaNCS_Dictionary_Specification_1.0_Latest.xlsx";
              String excelPath=InputExcel.inputExcel();
          FileInputStream fileInputStream = new FileInputStream(new File(excelPath));
  
          // Create Workbook instance holding .xls file
          log.info("Creating workbook instance for XSSFWorkbook");
          XSSFWorkbook workbook = new XSSFWorkbook(fileInputStream);
  
          // Get the first worksheet
          log.info("Creating the sheet of XSSFSheet");
          XSSFSheet sheet = workbook.getSheet("DictionarySpecification");
          int i=InputExcelValidator.DictionarySpecificationRowsValidator(sheet);
  
          // Iterate through each rows
          log.info("Creating RowIterator to iterate through the rows");
          Iterator&lt;Row&gt; rowIterator = sheet.iterator();
  
          while (rowIterator.hasNext()) {
              // Get Each Row
              log.info("Getting each row one by one");
              Row row = rowIterator.next();
              log.info("Assigning the value of tempForEmptyRowCount2 to tempForEmptyRowCount1");
              int tempForEmptyRowCount2=tempForEmptyRowCount1;
              log.info("Getting the rowNumber of Current Iteration");
              tempForEmptyRowCount1=row.getRowNum();
              if(row.getRowNum()==0){
                  log.info("Skipping The first row of the Excel File");
                  continue;
              }
              if (row.getRowNum() &lt;= 25 &amp;&amp; row.getRowNum()&gt;0) {
                  log.info("Adding the Dictionary Specification Values and calling addDictionarySpecifications");
                  addDictionarySpecifications(tempForEmptyRowCount2, rowIterator, row);
                  continue;
              }
              if(row.getRowNum()-tempForEmptyRowCount2&gt;2){
                  log.error("Please correct the format to input table details");
                  throw new TableInputFormatException("Please correct the format to input table details");
              }
  
              if (row.getRowNum()-tempForEmptyRowCount2&gt;1) {
                  log.info("Skipping Empty Row");
                  tempForAddingValuesToTable1 = 1;
                  tempForAddingValuesToTable2 = false;
                  tempForTableCount++;
                  continue;
              }
              log.info("Creating CellIterator inatance");
              Iterator&lt;Cell&gt; cellIterator = row.cellIterator();
              if (tempForAddingValuesToTable1 == 1 &amp;&amp; tempForAddingValuesToTable2 == false) {
                  log.info("Adding the table values");
                  Table table = new Table();
                  log.info("Creating an empty arrayList in Table for fields");
                  table.setFieldList(new ArrayList&lt;Field&gt;());
                  while (cellIterator.hasNext()) {
                      log.info("Iterating the cells for table values");
                      Cell cell = cellIterator.next();
                      int columnIndex = cell.getColumnIndex();
                      switch (columnIndex + 1) {
                          case 1:
                              log.info("Adding the table name");
                              table.setName(cell.getStringCellValue().trim());
                              break;
                          case 2:
                              log.info("Adding the table annotation");
                              table.setAnnotation(cell.getStringCellValue().trim());
                              break;
                          case 3:
                              log.info("Adding the table Identifier");
                              table.setIdentifier(cell.getStringCellValue().trim());
                              break;
                          case 4:
                              log.info("Adding the table FieldPosition");
                              switch (cell.getCellType()){
                                  case Cell.CELL_TYPE_STRING:
                                      table.setFieldPosition(Integer.parseInt( cell.getStringCellValue().trim()));
                                      break;
                                  case Cell.CELL_TYPE_NUMERIC:
                                      table.setFieldPosition((int) cell.getNumericCellValue());
                                      break;
                              }
  
                              break;
                          case 5:
                              log.info("Adding the table RecordType");
                              switch (cell.getCellType()){
                                  case Cell.CELL_TYPE_STRING:
                                      table.setRecordType( cell.getStringCellValue());
                                      break;
                                  case Cell.CELL_TYPE_NUMERIC:
                                      table.setRecordType( String.valueOf(cell.getNumericCellValue()));
                                      break;
                              }
                              break;
                      }
                  }
                  log.info("Adding the table to Tables");
                  tables.getTableList().add(table);
                  tempForAddingValuesToTable2=true;
                  continue;
              }
              if (tempForAddingValuesToTable1 == 1 &amp;&amp; tempForAddingValuesToTable2 == true) {
                  log.info("Skipping Empty Row");
                  tempForAddingValuesToTable1=0;
                  continue;
              }
              if (tempForAddingValuesToTable1 == 0 &amp;&amp; tempForAddingValuesToTable2 == true) {
                  log.info("Creating Field Instance");
                  Field field = new Field();
                  while (cellIterator.hasNext()) {
                      log.info("Adding the field values one by one");
                      Cell cell = cellIterator.next();
                      int columnIndex = cell.getColumnIndex();
                      int tempColumnIndex = columnIndexIndicator;
                      if (tempColumnIndex - columnIndexIndicator &gt; 1) {
                          field.setDefaultValue("null");
                      }
                      switch (columnIndex + 1) {
                          case 1:
                              log.info("Adding name for field");
                              field.setName(cell.getStringCellValue().trim());
                              break;
                          case 2:
                              log.info("Adding Annotation for field");
                              field.setAnnotation(cell.getStringCellValue().trim());
                              break;
                          case 3:
                              log.info("Adding DataType for field");
                              field.setDataType(cell.getStringCellValue());
                              break;
  
                          case 4:
                              log.info("Adding Size for field");
                              switch (cell.getCellType()) {
                                  case Cell.CELL_TYPE_STRING:
                                      field.setSize(cell.getStringCellValue().trim());
                                      break;
                                  case Cell.CELL_TYPE_NUMERIC:
                                      Double doubleValue=cell.getNumericCellValue();
                                      DecimalFormat format = new DecimalFormat("0.#");
                                      field.setSize(format.format(doubleValue));
                                      break;
                              }
                              break;
  
                          case 5:
                              log.info("Adding pKey for field");
                              if (cell.getCellType() == cell.CELL_TYPE_STRING) {
                                  String s2 = cell.getStringCellValue();
  
                                  if (s2.equals("Yes"))
                                      tempForAddingBooleanValuesToTable = true;
                                  else
                                      tempForAddingBooleanValuesToTable = false;
                                  field.setpKey(tempForAddingBooleanValuesToTable);
                              }
                              break;
                          case 6:
                              log.info("Adding Mandatory for field");
                              if (cell.getStringCellValue().equals("Yes"))
                                  tempForAddingBooleanValuesToTable = true;
                              else
                                  tempForAddingBooleanValuesToTable = false;
                              field.setMandatory(tempForAddingBooleanValuesToTable);
                              break;
                          case 7:
                              log.info("Adding DefaultValue for field");
                              switch (cell.getCellType()) {
                                  case Cell.CELL_TYPE_STRING:
                                      field.setDefaultValue(cell.getStringCellValue().trim());
  
                                      break;
                                  case Cell.CELL_TYPE_NUMERIC:
                                      Double doubleValue=cell.getNumericCellValue();
                                      DecimalFormat format = new DecimalFormat("0.####");
                                      field.setDefaultValue(format.format(doubleValue));
                                      break;
                              }
                              break;
                          case 8:
                              log.info("Adding Rec_Identifier for field");
                              if (cell.getCellType() == cell.CELL_TYPE_NUMERIC) {
                                  int i2 = (int) cell.getNumericCellValue();
                                  String s = String.valueOf(i2);
                                  if (s.equals("Yes"))
                                      tempForAddingBooleanValuesToTable = true;
                                  else
                                      tempForAddingBooleanValuesToTable = false;
                                  field.setRec_Identifier(tempForAddingBooleanValuesToTable);
                              }
                              break;
                          case 9:
                              log.info("Adding Visible for field");
                              if (cell.getStringCellValue().equals("Yes"))
                                  tempForAddingBooleanValuesToTable = true;
                              else
                                  tempForAddingBooleanValuesToTable = false;
                              field.setVisible(tempForAddingBooleanValuesToTable);
                              break;
  
                      }
                      columnIndexIndicator = cell.getColumnIndex();
  
  
                  }
                  if(field.getSize()==null){
                      log.info("Setting the DateFormat");
                      field.setDateFormat("DDMMYYYY");
                  }
                  log.info("Adding the field to specific table");
                  tables.getTableList().get(tempForTableCount).getFieldList().add(field);
              }
          }
          log.info("Setting properties to respective lists");
          recordProperties.setProperties(propertyList1);
          fileProperties.setProperties(propertyList2);
          dataDictionary.setDictionary(dictionary);
          dataDictionary.setFileProperties(fileProperties);
          dataDictionary.setRecordProperties(recordProperties);
          dataDictionary.setTables(tables);
      }
      catch (IOException ie) {
          log.error("Exception Occured: IOException");
          ie.printStackTrace();
      }
      log.info("Calling the createXML to generate the xml file");
      CreateXML.createXML(dataDictionary);
  }
  public static int addDictionarySpecifications(int j, Iterator&lt;Row&gt; rowIterator,Row row){
     log.info("Getting the CellIterator");
      Iterator&lt;Cell&gt; cellIterator = row.cellIterator();
  
  
      if(row.getRowNum()-j&gt;1){
          log.info("Getting Empty Row");
          rowIndicator++;
          tempForSkippingRow=true;
          // return 0;
      }
      if(tempForSkippingRow){
          log.info("Skipping Row");
          tempForSkippingRow=false;
          return 0;
  
      }
      log.info("Creating instance of Property Object");
      Property property=new Property();
      while (cellIterator.hasNext()) {
          log.info("Getting Cells one by one");
          Cell cell = cellIterator.next();
          log.info("Getting the columnIndex of Current Row");
          int columnIndex = cell.getColumnIndex();
  
          if(rowIndicator==1) {
              log.info("Adding the Dictionary Nsme and annotation and type");
              switch (columnIndex + 1) {
                  case 2:
                      dictionary.setName(cell.getStringCellValue().trim());
                      dictionary.setAnnotation(dictionary.getName());
                      dictionary.setType("DATABASE_TABLES");
                      break;
              }
          }
          if(rowIndicator&gt;1){
              log.info("Adding the Properties for FileProperties and Record Properties");
              switch(columnIndex+1){
                  case 1:
                      log.info("GEtting the annotation");
                      String annotation=cell.getStringCellValue().trim();
                      String propertyName;
                      if(annotation.equals("Record Composition")) {
                          log.info("Property is Record Composition");
                          property.setName("COMPOSITION");
                      }
                      else if(annotation.equals("Record Heirarchy")) {
                          log.info("Property is Record Heirarchy");
                          property.setName("HEIRARCHY");
                      }
                      else if(annotation.equals("Set Feed Quality Standards")) {
                          log.info("Property is Set Feed Quality Standards");
                          property.setName("FQD");
                          property.setAnnotation("FQD");
                          break;
                      }
                      else if(annotation.equals("Quality Percentage")) {
                          log.info("Property is Quality Percentage");
                          property.setName("FQD_PERCENT");
                          property.setAnnotation("FQD Percent");
                          break;
                      }
                      else if(annotation.equals("Header Record")) {
                          log.info("Property is Header Record");
                          property.setName("HEADER");
                      }
                      else if(annotation.equals("Trailer Record")) {
                          log.info("Property is Trailer Record");
                          property.setName("TRAILER");
                      }
                      else {
                          log.info("Creating exact name for Property");
                          String[] split = annotation.split("\\s+");
                          String s1=split[0].toUpperCase();
                          String s2=split[1].toUpperCase();
                          propertyName=s1+"_"+s2;
                          log.info("Property is"+propertyName);
                          property.setName(propertyName);
                      }
                      property.setAnnotation(annotation);
                      break;
                  case 2:
                      log.info("Setting the valuedescription");
                      String valueDesscription=null;
                      switch (cell.getCellType()) {
                          case Cell.CELL_TYPE_STRING:
                              valueDesscription=cell.getStringCellValue().trim();
  
                              break;
                          case Cell.CELL_TYPE_NUMERIC:
                              try {
                                  valueDesscription=String.valueOf(cell.getNumericCellValue()).trim();
                              } catch (Exception e) {
                                  e.printStackTrace();
                              }
                              break;
                      }
  
                      if(valueDesscription.equals("Multiple Type of Records"))
                          property.setDefaultValue("HETEROGENOUS");
                      else if(valueDesscription.equals("Single Type of Records"))
                          property.setDefaultValue("HOMOGENOUS");
                      else if(valueDesscription.equals("Record Group Without heirarchy"))
                          property.setDefaultValue("GROUPED");
                      else if(valueDesscription.equals("Record Group With heirarchy"))
                          property.setDefaultValue("HEIRARCHY");
                      else if(valueDesscription.equals("Variable Length"))
                          property.setDefaultValue("VARIABLE_LENGTH");
                      else if(valueDesscription.equals("Carriage return line feed(CRLF)"))
                          property.setDefaultValue("CRLF");
                      else if(valueDesscription.equals("Comma(,)"))
                          property.setDefaultValue(",");
                      else if(valueDesscription.equals("Semicolon(;"))
                          property.setDefaultValue(";");
                      else if(valueDesscription.equals("Tilda(~)"))
                          property.setDefaultValue("~");
                      else if(valueDesscription.equals("Pipe(|)"))
                          property.setDefaultValue("|");
                      else if(valueDesscription.equals("Horizontal Tab(HT)"))
                          property.setDefaultValue("HT");
                      else if(valueDesscription.equals("Hash(#)"))
                          property.setDefaultValue("#");
                      else if(valueDesscription.equals("No"))
                          property.setDefaultValue("false");
                      else if(valueDesscription.equals("FAILED"))
                          property.setDefaultValue("FAILED");
                      else if(valueDesscription.equals("File Content"))
                          property.setDefaultValue("HASH_DUP");
                      else if(valueDesscription.equals("File Name"))
                          property.setDefaultValue("FILE_NAME");
                      else if(valueDesscription.equals("Yes"))
                          property.setDefaultValue("true");
                      else
                          property.setDefaultValue(valueDesscription);
                      property.setValueDescription(valueDesscription);
                      break;
                  case 3:
                      log.info("Setting the annotation valueDescription and default Value");
                      property.setAnnotation("Duplicate Duration");
                      property.setName("DUPLICATE_DURATION");
                      property.setValueDescription(cell.getStringCellValue().trim());
                      property.setDefaultValue(property.getAnnotation());
                      break;
              }
          }
      }
      if(rowIndicator&gt;1) {
          log.info("Adding the property to PropertyList");
          if (property.getDefaultValue().equals("HETEROGENOUS") || property.getDefaultValue().equals("HOMOGENOUS") || property.getDefaultValue().equals("GROUPED") || property.getDefaultValue().equals("HEIRARCHY"))
              propertyList1.add(property);
          else
              propertyList2.add(property);
      }
      return 0;
  }
  </code></pre>