Java 类org.apache.poi.ss.usermodel.Row.MissingCellPolicy 实例源码

项目:teemo    文件:ExcelReader.java   
@Override
public IRow readRow() {
    SheetData vData = getLocalData();
    int vRowIndex = vData.getCurrentIndex();
    if (vRowIndex < vData.getRowCount()) {
        Row vRow = vData.getSheet().getRow(vRowIndex);
        String[] vTitles = vData.getTitles();
        Cell[] vValues = new Cell[vTitles.length];
        for (int i = 0; i < vTitles.length; ++i) {
            Cell vCell = vRow.getCell(i, MissingCellPolicy.CREATE_NULL_AS_BLANK);
            vValues[i] = vCell;
        }
        vData.setCurrentIndex(vRowIndex + 1);
        return new RowExcelImpl(vRowIndex, vTitles, vValues);
    }
    // read over, remove the local data
    removeLocalData();
    return null;
}
项目:Windmill    文件:ExcelExporter.java   
private void setCellValue(final Object value, final int columnIndex) {
    Cell cell = currentExcelRow.getCell(
        sheetConfig.columnOrigin() + columnIndex,
        MissingCellPolicy.CREATE_NULL_AS_BLANK
    );
    sheetConfig.cellStyler().style(cell);

    if(value == null) {
        return;
    }

    // numbers
    if (value instanceof Integer) {
        cell.setCellValue(Double.valueOf(((Integer) value).intValue()));
    } else if (value instanceof Long) {
        cell.setCellValue(Double.valueOf(((Long) value).longValue()));
    } else if (value instanceof Float) {
        cell.setCellValue(Double.valueOf(((Float) value).floatValue()));
    } else if (value instanceof BigDecimal) {
        cell.setCellValue(((BigDecimal) value).doubleValue());
    } else if (value instanceof Double) {
        cell.setCellValue((Double) value);
    }
    // other types
    else if (value instanceof Boolean) {
        cell.setCellValue(((Boolean) value).booleanValue());
    } else if (value instanceof Calendar) {
        cell.setCellValue((Calendar) value);
    } else if (value instanceof Date) {
        cell.setCellValue((Date) value);
    } else if (value instanceof String) {
        cell.setCellValue((String) value);
    }

    else {
        cell.setCellValue(value.toString());
    }
}
项目:meja    文件:PoiRow.java   
@Override
public PoiCell getCell(int col) {
    org.apache.poi.ss.usermodel.Cell poiCell = poiRow.getCell(col, MissingCellPolicy.CREATE_NULL_AS_BLANK);
    return new PoiCell(this, poiCell);
}
项目:data-prep    文件:StreamingWorkbook.java   
/**
 * Not supported
 */
@Override
public MissingCellPolicy getMissingCellPolicy() {
    throw new UnsupportedOperationException();
}
项目:data-prep    文件:StreamingWorkbook.java   
/**
 * Not supported
 */
@Override
public void setMissingCellPolicy(MissingCellPolicy missingCellPolicy) {
    throw new UnsupportedOperationException();
}
项目:excel-streaming-reader    文件:StreamingWorkbook.java   
/**
 * Not supported
 */
@Override
public MissingCellPolicy getMissingCellPolicy() {
  throw new UnsupportedOperationException();
}
项目:excel-streaming-reader    文件:StreamingWorkbook.java   
/**
 * Not supported
 */
@Override
public void setMissingCellPolicy(MissingCellPolicy missingCellPolicy) {
  throw new UnsupportedOperationException();
}
项目:brigen-base    文件:PoiMethods.java   
public static Cell getCell(Row row, int col, MissingCellPolicy mcp) {
    if (row == null) {
        return null;
    }
    return row.getCell(col, mcp);
}