Package com.storedobject.office
Class AbstractSpreadSheet
java.lang.Object
com.storedobject.core.StreamContentProducer
com.storedobject.office.AbstractSpreadSheet
- All Implemented Interfaces:
Executable
,ContentProducer
,ContentType
,Closeable
,AutoCloseable
,Runnable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic int
protected org.apache.poi.ss.usermodel.Workbook
Fields inherited from class com.storedobject.core.StreamContentProducer
out
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method may be called when the content generation is aborted due to some error.void
close()
protected abstract org.apache.poi.ss.usermodel.Workbook
void
Generate the content here and write to 'out'org.apache.poi.ss.usermodel.Cell
getCell()
org.apache.poi.ss.usermodel.Cell
getCell
(int cell, int row) org.apache.poi.ss.usermodel.Cell
getCell
(int cell, int row, int sheet) org.apache.poi.ss.usermodel.Cell
int
org.apache.poi.ss.usermodel.Cell[][]
org.apache.poi.ss.usermodel.CellStyle
org.apache.poi.ss.usermodel.Cell[]
getColumnCells
(String rangeAddress) org.apache.poi.ss.usermodel.CellStyle
org.apache.poi.ss.usermodel.CellStyle
org.apache.poi.ss.usermodel.CellStyle
org.apache.poi.ss.usermodel.Cell
org.apache.poi.ss.usermodel.Row
org.apache.poi.ss.usermodel.Sheet
org.apache.poi.ss.usermodel.CellStyle
getNumericStyle
(int width, int decimals) org.apache.poi.ss.usermodel.CellStyle
getNumericStyle
(int width, int decimals, boolean separated) org.apache.poi.ss.usermodel.CellStyle
org.apache.poi.ss.usermodel.CellStyle
org.apache.poi.ss.usermodel.Cell
org.apache.poi.ss.usermodel.Row
org.apache.poi.ss.usermodel.Sheet
org.apache.poi.ss.usermodel.CellStyle
org.apache.poi.ss.usermodel.Row
getRow()
org.apache.poi.ss.usermodel.Row
getRow
(int row) org.apache.poi.ss.usermodel.Row
getRow
(int row, int sheet) org.apache.poi.ss.usermodel.Cell[]
getRowCells
(String rangeAddress) int
org.apache.poi.ss.usermodel.Sheet
getSheet()
org.apache.poi.ss.usermodel.Sheet
getSheet
(int sheet) int
org.apache.poi.ss.usermodel.Workbook
void
goToCell
(int cell) void
goToCell
(int cell, int row) void
goToCell
(int cell, int row, int sheet) void
void
goToRow
(int row) static boolean
isSameSize
(String rangeAddress1, String rangeAddress2) void
moveDown()
boolean
moveLeft()
void
boolean
moveUp()
abstract void
Re-evaluate all formula in the worksheet.void
save
(OutputStream out) void
void
setCellValue
(Object cellValue) Set a value to the current cell.void
setCellValue
(org.apache.poi.ss.usermodel.Cell cell, Object cellValue) Set a value to a cell.void
setCellValues
(Object... cellValues) Set cell values to consecutive cells from left to right, starting from the current cell.static boolean
validateCellAddress
(String cellAddress) static boolean
validateColumnAddress
(String rangeAddress) static boolean
validateRangeAddress
(String rangeAddress) static boolean
validateRowAddress
(String rangeAddress) Methods inherited from class com.storedobject.core.StreamContentProducer
getContent, getError, getFileName, getTransactionManager, getWriter, produce, setTransactionManager
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.storedobject.core.ContentProducer
execute, extractContent, getEntity, getFileExtension, getStreamData, getStreamDataProvider, getSystemEntity, saveTo, saveTo, saveTo, saveTo
Methods inherited from interface com.storedobject.core.ContentType
getContentType, getLink, getMimeType, isAudio, isHTML, isImage, isLink, isMedia, isPDF, isText, isVideo
Methods 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.- 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.- Parameters:
cellValues
- Cell values to set.
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classStreamContentProducer
-
abort
Description copied from interface:ContentProducer
This method may be called when the content generation is aborted due to some error.Note: This could be invoked multiple times.
- Specified by:
abort
in interfaceContentProducer
- Overrides:
abort
in classStreamContentProducer
- Parameters:
error
- Error.
-
generateContent
Description copied from class:StreamContentProducer
Generate the content here and write to 'out'- Specified by:
generateContent
in 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
-
recompute
public abstract void recompute()Re-evaluate all formula in the worksheet. -
getDevice
-