Example #1
0
  @Override
  public void write(DataRow dataRow) {
    synchronized (syncObj) {
      //            if( isClosed() )
      //                throw new IllegalStateException("is closed");

      MetaData metaData = dataRow.getMetaData();

      if (writeMetaData && !isMetaDataWrited(dataRow)) {
        writeMetaData(metaData);
        setMetaDataWrited(dataRow, true);
        moveToNextRow();
      }

      Column[] columns = metaData.getColumns();
      for (int colIdx = 0; colIdx < columns.length; colIdx++) {
        Object value = dataRow.get(colIdx);
        if (value == null) {
          writeNullCellValue(
              getCurrentRow(), colIdx, getHelper(getCurrentWorkbook()), null, columns[colIdx]);
        } else {
          writeCellValue(
              getCurrentRow(),
              colIdx,
              getHelper(getCurrentWorkbook()),
              null,
              value,
              columns[colIdx]);
        }
      }
      moveToNextRow();
    }
  }
Example #2
0
 protected void setMetaDataWrited(DataRow dataRow, boolean writed) {
   setMetaDataWrited(dataRow.getMetaData(), writed);
 }
Example #3
0
 protected boolean isMetaDataWrited(DataRow dataRow) {
   return isMetaDataWrited(dataRow.getMetaData());
 }