org.jxls.transform.poi.PoiRowData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jxls-poi Show documentation
Show all versions of jxls-poi Show documentation
Apache POI based Transformer implementation for Jxls library
package org.jxls.transform.poi;
import org.jxls.common.CellData;
import org.jxls.common.CellRef;
import org.jxls.common.RowData;
import org.apache.poi.ss.usermodel.Row;
/**
* Row data wrapper for POI row
* @author Leonid Vysochyn
* Date: 2/1/12
*/
public class PoiRowData extends RowData {
Row row;
public static RowData createRowData(Row row){
if( row == null ) return null;
PoiRowData rowData = new PoiRowData();
rowData.row = row;
rowData.height = row.getHeight();
int numberOfCells = row.getLastCellNum();
for(int cellIndex = 0; cellIndex < numberOfCells; cellIndex++){
org.apache.poi.ss.usermodel.Cell cell = row.getCell(cellIndex);
if(cell != null ){
CellData cellData = PoiCellData.createCellData(new CellRef(row.getSheet().getSheetName(), row.getRowNum(), cellIndex), cell);
rowData.addCellData(cellData);
}else{
rowData.addCellData(null);
}
}
return rowData;
}
public Row getRow() {
return row;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy