List of usage examples for org.apache.poi.xssf.usermodel XSSFSheet hasComments
public boolean hasComments()
From source file:org.bbreak.excella.reports.tag.ImageParamParser.java
License:Open Source License
/** * ????????//from ww w . ja v a 2s. co m * * @param sheet * @return true?false */ private boolean hasComments(Sheet sheet) { if (sheet instanceof XSSFSheet) { XSSFSheet xssfSheet = (XSSFSheet) sheet; return xssfSheet.hasComments(); } else if (sheet instanceof HSSFSheet) { Iterator<Row> rowIterator = sheet.iterator(); while (rowIterator.hasNext()) { Row row = rowIterator.next(); Iterator<Cell> cellIterator = row.iterator(); while (cellIterator.hasNext()) { Cell cell = cellIterator.next(); Comment comment = cell.getCellComment(); if (comment != null) { return true; } } } } return false; }