Java处理Excel

private String getCellStringVal(Cell cell) {
CellType cellType = (cell == null) ? CellType.BLANK : cell.getCellTypeEnum();
switch (cellType) {
case NUMERIC:
return cell.getStringCellValue();
case STRING:
return cell.getStringCellValue();
case BOOLEAN:
return String.valueOf(cell.getBooleanCellValue());
case FORMULA:
return cell.getCellFormula();
case BLANK:
return null;
case ERROR:
return String.valueOf(cell.getErrorCellValue());
default:
return null;
}
}

上一篇:java包装类


下一篇:java中int与Integer用==比较详解