@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(); } }
protected void setMetaDataWrited(DataRow dataRow, boolean writed) { setMetaDataWrited(dataRow.getMetaData(), writed); }
protected boolean isMetaDataWrited(DataRow dataRow) { return isMetaDataWrited(dataRow.getMetaData()); }