|
|
|
|
@ -30,7 +30,9 @@ public abstract class XLS extends AbstractComponent {
|
|
|
|
|
protected Row row;
|
|
|
|
|
/**현재 처리 중인 cell*/
|
|
|
|
|
protected Cell cell;
|
|
|
|
|
protected boolean sxssf;
|
|
|
|
|
protected boolean
|
|
|
|
|
sxssf,
|
|
|
|
|
eager;
|
|
|
|
|
|
|
|
|
|
/**주어진 InputStream을 로드한다.
|
|
|
|
|
* @param <T> XLS 유형
|
|
|
|
|
@ -96,9 +98,10 @@ public abstract class XLS extends AbstractComponent {
|
|
|
|
|
try {
|
|
|
|
|
sheet = workbook().getSheetAt(index);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
if (sxssf) {
|
|
|
|
|
if (eager) {
|
|
|
|
|
sheet = workbook().createSheet();
|
|
|
|
|
((SXSSFSheet)sheet).setRandomAccessWindowSize(rowAccessWindowSize);
|
|
|
|
|
if (sxssf)
|
|
|
|
|
((SXSSFSheet)sheet).setRandomAccessWindowSize(rowAccessWindowSize);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -120,9 +123,10 @@ public abstract class XLS extends AbstractComponent {
|
|
|
|
|
try {
|
|
|
|
|
Workbook wb = workbook();
|
|
|
|
|
sheet = wb.getSheet(name);
|
|
|
|
|
if (sheet == null && sxssf) {
|
|
|
|
|
if (sheet == null && eager) {
|
|
|
|
|
sheet = wb.createSheet(name);
|
|
|
|
|
((SXSSFSheet)sheet).setRandomAccessWindowSize(rowAccessWindowSize);
|
|
|
|
|
if (sxssf)
|
|
|
|
|
((SXSSFSheet)sheet).setRandomAccessWindowSize(rowAccessWindowSize);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!equals(sheet, worksheet)) {
|
|
|
|
|
@ -143,7 +147,7 @@ public abstract class XLS extends AbstractComponent {
|
|
|
|
|
*/
|
|
|
|
|
public XLS row(int index) {
|
|
|
|
|
row = worksheet.getRow(index);
|
|
|
|
|
if (row == null && sxssf)
|
|
|
|
|
if (row == null && eager)
|
|
|
|
|
row = worksheet.createRow(index);
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
@ -155,7 +159,7 @@ public abstract class XLS extends AbstractComponent {
|
|
|
|
|
*/
|
|
|
|
|
public XLS col(int index) {
|
|
|
|
|
cell = row != null ? row.getCell(index) : null;
|
|
|
|
|
if (cell == null && sxssf)
|
|
|
|
|
if (cell == null && eager)
|
|
|
|
|
cell = row.createCell(index);
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|