Package com.storedobject.office
Class AbstractSpreadSheet
java.lang.Object
com.storedobject.core.StreamContentProducer
com.storedobject.office.AbstractSpreadSheet
- All Implemented Interfaces:
Executable,ContentProducer,ContentType,RequiresTransactionManager,Closeable,AutoCloseable,Runnable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intprotected org.apache.poi.ss.usermodel.WorkbookFields inherited from class com.storedobject.core.StreamContentProducer
entity, out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method may be called when the content generation is aborted due to some error.voidclose()protected abstract org.apache.poi.ss.usermodel.Workbookfinal voidvoidGenerate the content here and write to 'out'org.apache.poi.ss.usermodel.CellgetCell()org.apache.poi.ss.usermodel.CellgetCell(int cell, int row) org.apache.poi.ss.usermodel.CellgetCell(int cell, int row, int sheet) org.apache.poi.ss.usermodel.Cellintorg.apache.poi.ss.usermodel.Cell[][]org.apache.poi.ss.usermodel.CellStyleorg.apache.poi.ss.usermodel.Cell[]getColumnCells(String rangeAddress) org.apache.poi.ss.usermodel.CellStyleorg.apache.poi.ss.usermodel.CellStyleorg.apache.poi.ss.usermodel.CellStyleorg.apache.poi.ss.usermodel.Cellorg.apache.poi.ss.usermodel.Roworg.apache.poi.ss.usermodel.Sheetorg.apache.poi.ss.usermodel.CellStylegetNumericStyle(int width, int decimals) org.apache.poi.ss.usermodel.CellStylegetNumericStyle(int width, int decimals, boolean separated) org.apache.poi.ss.usermodel.CellStyleorg.apache.poi.ss.usermodel.CellStyleorg.apache.poi.ss.usermodel.Cellorg.apache.poi.ss.usermodel.Roworg.apache.poi.ss.usermodel.Sheetorg.apache.poi.ss.usermodel.CellStyleorg.apache.poi.ss.usermodel.RowgetRow()org.apache.poi.ss.usermodel.RowgetRow(int row) org.apache.poi.ss.usermodel.RowgetRow(int row, int sheet) org.apache.poi.ss.usermodel.Cell[]getRowCells(String rangeAddress) intorg.apache.poi.ss.usermodel.SheetgetSheet()org.apache.poi.ss.usermodel.SheetgetSheet(int sheet) intorg.apache.poi.ss.usermodel.WorkbookvoidgoToCell(int cell) voidgoToCell(int cell, int row) voidgoToCell(int cell, int row, int sheet) voidvoidgoToRow(int row) static booleanisSameSize(String rangeAddress1, String rangeAddress2) voidmoveDown()booleanmoveLeft()voidbooleanmoveUp()voidsave(OutputStream out) voidvoidsetCellValue(Object cellValue) Set a value to the current cell.voidsetCellValue(org.apache.poi.ss.usermodel.Cell cell, Object cellValue) Set a value to a cell.voidsetCellValues(Object... cellValues) Set cell values to consecutive cells from left to right, starting from the current cell.voidsetFeedback(Consumer<String> feedback) static booleanvalidateCellAddress(String cellAddress) static booleanvalidateColumnAddress(String rangeAddress) static booleanvalidateRangeAddress(String rangeAddress) static booleanvalidateRowAddress(String rangeAddress) Methods inherited from class com.storedobject.core.StreamContentProducer
getContent, getEntity, getError, getFileName, getReportFormat, getTransactionManager, getWriter, isBlocked, isBlocked, produce, ready, setTransactionManagerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.core.ContentProducer
execute, extractContent, getFileExtension, getStreamData, getStreamDataProvider, getSystemEntity, saveTo, saveTo, saveTo, saveToMethods inherited from interface com.storedobject.core.ContentType
getContentType, getLink, getMimeType, isAudio, isHTML, isImage, isLink, isMedia, isPDF, isText, isVideoMethods inherited from interface com.storedobject.common.Executable
act, run
-
Field Details
-
MAX_ROWS
public static int MAX_ROWS -
workbook
protected org.apache.poi.ss.usermodel.Workbook workbook
-
-
Constructor Details
-
AbstractSpreadSheet
Constructor.- Parameters:
in- Input stream containing a spreadsheet file with some content.out- Output is written to this stream.
-
-
Method Details
-
createWorkbook
protected abstract org.apache.poi.ss.usermodel.Workbook createWorkbook(InputStream in) throws Exception - Throws:
Exception
-
save
- Throws:
IOException
-
save
- Throws:
IOException
-
getWorkbook
public org.apache.poi.ss.usermodel.Workbook getWorkbook() -
getSheetIndex
public int getSheetIndex() -
getSheet
public org.apache.poi.ss.usermodel.Sheet getSheet() -
getSheet
public org.apache.poi.ss.usermodel.Sheet getSheet(int sheet) -
getNextSheet
public org.apache.poi.ss.usermodel.Sheet getNextSheet() -
getPreviousSheet
public org.apache.poi.ss.usermodel.Sheet getPreviousSheet() -
getRowIndex
public int getRowIndex() -
getRow
public org.apache.poi.ss.usermodel.Row getRow() -
getRow
public org.apache.poi.ss.usermodel.Row getRow(int row) -
getRow
public org.apache.poi.ss.usermodel.Row getRow(int row, int sheet) -
getNextRow
public org.apache.poi.ss.usermodel.Row getNextRow() -
getPreviousRow
public org.apache.poi.ss.usermodel.Row getPreviousRow() -
getCellIndex
public int getCellIndex() -
getCell
public org.apache.poi.ss.usermodel.Cell getCell() -
getCell
public org.apache.poi.ss.usermodel.Cell getCell(int cell, int row) -
getCell
public org.apache.poi.ss.usermodel.Cell getCell(int cell, int row, int sheet) -
getCell
-
getCells
-
getColumnCells
-
getRowCells
-
getNextCell
public org.apache.poi.ss.usermodel.Cell getNextCell() -
getPreviousCell
public org.apache.poi.ss.usermodel.Cell getPreviousCell() -
goToCell
-
goToCell
public void goToCell(int cell, int row, int sheet) -
goToCell
public void goToCell(int cell, int row) -
goToCell
public void goToCell(int cell) -
goToRow
public void goToRow(int row) -
moveLeft
public boolean moveLeft() -
moveRight
public void moveRight() -
moveUp
public boolean moveUp() -
moveDown
public void moveDown() -
setCellValue
Set a value to the current cell. If the value can't be set because the type is not supported, its stringified version will be set.- Parameters:
cellValue- Value to set.
-
setCellValue
Set a value to a cell. If the value can't be set because the type is not supported, its stringified version will be set.Note: The cursor won't move to the next cell.
- Parameters:
cell- Cell to which value needs to be set.cellValue- Value to set.
-
setCellValues
Set cell values to consecutive cells from left to right, starting from the current cell. For null values, respective cells will be skipped.Note: The cursor does move to the next cell.
- Parameters:
cellValues- Cell values to set.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classStreamContentProducer
-
abort
Description copied from interface:ContentProducerThis method may be called when the content generation is aborted due to some error.Note: This could be invoked multiple times.
- Specified by:
abortin interfaceContentProducer- Overrides:
abortin classStreamContentProducer- Parameters:
error- Error.
-
generateContent
Description copied from class:StreamContentProducerGenerate the content here and write to 'out'- Specified by:
generateContentin classStreamContentProducer- Throws:
Exception- Can throw anything
-
getDateStyle
public org.apache.poi.ss.usermodel.CellStyle getDateStyle() -
getDateTimeStyle
public org.apache.poi.ss.usermodel.CellStyle getDateTimeStyle() -
getHourStyle
public org.apache.poi.ss.usermodel.CellStyle getHourStyle() -
getPercentageStyle
public org.apache.poi.ss.usermodel.CellStyle getPercentageStyle() -
getPercentage2Style
public org.apache.poi.ss.usermodel.CellStyle getPercentage2Style() -
getRightAlignedStyle
public org.apache.poi.ss.usermodel.CellStyle getRightAlignedStyle() -
getCenteredStyle
public org.apache.poi.ss.usermodel.CellStyle getCenteredStyle() -
getNumericStyle
public org.apache.poi.ss.usermodel.CellStyle getNumericStyle(int width, int decimals) -
getNumericStyle
public org.apache.poi.ss.usermodel.CellStyle getNumericStyle(int width, int decimals, boolean separated) -
validateCellAddress
-
validateRangeAddress
-
validateRowAddress
-
validateColumnAddress
-
isSameSize
-
getDevice
-
setFeedback
-
feedback
-