/** * Get the value of the cell as an error code. * <p> * For strings, numbers, and booleans, we throw an exception. * For blank cells we return a 0. * </p> * * @return the value of the cell as an error code * @throws IllegalStateException if the cell type returned by {@link #getCellType()} isn't {@link CellType #ERROR} * @see FormulaError */ @Override public byte getErrorCellValue() throws IllegalStateException { String code = getErrorCellString(); if (code == null) { return 0; } try { return FormulaError.forString(code).getCode(); } catch (final IllegalArgumentException e) { throw new IllegalStateException("Unexpected error code", e); } }
case ERROR: value = cell.getErrorCellString(); break; case FORMULA: if (cell.getCachedFormulaResultType() == CellType.STRING) {
/** * Get the value of the cell as an error code. * <p> * For strings, numbers, and booleans, we throw an exception. * For blank cells we return a 0. * </p> * * @return the value of the cell as an error code * @throws IllegalStateException if the cell type returned by {@link #getCellType()} isn't CELL_TYPE_ERROR * @see FormulaError */ public byte getErrorCellValue() { String code = getErrorCellString(); if (code == null) { return 0; } return FormulaError.forString(code).getCode(); }
/** * Get the value of the cell as an error code. * <p> * For strings, numbers, and booleans, we throw an exception. * For blank cells we return a 0. * </p> * * @return the value of the cell as an error code * @throws IllegalStateException if the cell type returned by {@link #getCellType()} isn't {@link CellType #ERROR} * @see FormulaError */ @Override public byte getErrorCellValue() throws IllegalStateException { String code = getErrorCellString(); if (code == null) { return 0; } try { return FormulaError.forString(code).getCode(); } catch (final IllegalArgumentException e) { throw new IllegalStateException("Unexpected error code", e); } }
private void mapCellOnNode(XSSFCell cell, Node node, STXmlDataType.Enum outputDataType) { String value =""; switch (cell.getCellType()) { case XSSFCell.CELL_TYPE_STRING: value = cell.getStringCellValue(); break; case XSSFCell.CELL_TYPE_BOOLEAN: value += cell.getBooleanCellValue(); break; case XSSFCell.CELL_TYPE_ERROR: value = cell.getErrorCellString(); break; case XSSFCell.CELL_TYPE_FORMULA: value = cell.getStringCellValue(); break; case XSSFCell.CELL_TYPE_NUMERIC: value += cell.getRawValue(); break; default: ; } if (node instanceof Element) { Element currentElement = (Element) node; currentElement.setTextContent(value); } else { node.setNodeValue(value); } }
if (cell instanceof XSSFCell) { String value = ((XSSFCell) cell).getErrorCellString(); errorResult = value; } else {
if (cell instanceof XSSFCell) { String value = ((XSSFCell) cell).getErrorCellString(); errorResult = value; } else {
if (cell instanceof XSSFCell) { String value = ((XSSFCell) cell).getErrorCellString(); errorResult = value; } else {
case ERROR: value = cell.getErrorCellString(); break; case FORMULA: if (cell.getCachedFormulaResultType() == CellType.STRING) {