Class ExcelWorksheet
- java.lang.Object
-
- org.eclipse.epsilon.emc.spreadsheets.SpreadsheetWorksheet
-
- org.eclipse.epsilon.emc.spreadsheets.excel.ExcelWorksheet
-
public class ExcelWorksheet extends SpreadsheetWorksheet
-
-
Field Summary
Fields Modifier and Type Field Description protected ExcelModel
model
protected org.apache.poi.ss.usermodel.Sheet
sheet
-
Fields inherited from class org.eclipse.epsilon.emc.spreadsheets.SpreadsheetWorksheet
alias, dataTypeStrict, existsInSpreadsheet, header, name
-
-
Constructor Summary
Constructors Constructor Description ExcelWorksheet(ExcelModel model, org.apache.poi.ss.usermodel.Sheet sheet, boolean existsInSpreadsheet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SpreadsheetColumn
createColumn(int index)
Creates a column with the specified column indexprotected void
createInSpreadsheet()
The purpose of this method is to create this worksheet in the spreadsheetjava.lang.String
getDefaultEmptyCellValue()
This method returns the default value to be written to a cell when a new empty row is created in a worksheet that is not enforcing data type strictness.int
getFirstRowIndex()
int
getHeaderRowIndex()
java.util.List<SpreadsheetRow>
getRows()
Gets all rows contained by the worksheetSpreadsheetRow
insertRow(java.util.Map<SpreadsheetColumn,java.lang.String> values)
Inserts a new row in the worksheet with given values in the given columns.protected void
loadHeader()
Loads header row information - index and name - from the spreadsheet if the worksheet exists in the spreadsheetvoid
removeRow(SpreadsheetRow row)
Deletes the given row from the actual worksheet.-
Methods inherited from class org.eclipse.epsilon.emc.spreadsheets.SpreadsheetWorksheet
addColumn, addColumn, addRow, addRowWithValuesInColumns, addWorksheetMetadata, checkThatWorksheetExists, deleteRow, findRows, getAlias, getColumn, getColumn, getDoesNotExistInSpreadsheet, getExistsInSpreadsheet, getHeader, getModel, getName, getNonexistentWorksheetMessage, getValuesForEmptyRow, isDataTypeStrict, isIdentifiablyBy, toString
-
-
-
-
Field Detail
-
model
protected ExcelModel model
-
sheet
protected org.apache.poi.ss.usermodel.Sheet sheet
-
-
Constructor Detail
-
ExcelWorksheet
public ExcelWorksheet(ExcelModel model, org.apache.poi.ss.usermodel.Sheet sheet, boolean existsInSpreadsheet)
-
-
Method Detail
-
createInSpreadsheet
protected void createInSpreadsheet()
Description copied from class:SpreadsheetWorksheet
The purpose of this method is to create this worksheet in the spreadsheet- Specified by:
createInSpreadsheet
in classSpreadsheetWorksheet
-
loadHeader
protected void loadHeader()
Description copied from class:SpreadsheetWorksheet
Loads header row information - index and name - from the spreadsheet if the worksheet exists in the spreadsheet- Specified by:
loadHeader
in classSpreadsheetWorksheet
-
createColumn
protected SpreadsheetColumn createColumn(int index)
Description copied from class:SpreadsheetWorksheet
Creates a column with the specified column index- Specified by:
createColumn
in classSpreadsheetWorksheet
- Returns:
- column
-
getRows
public java.util.List<SpreadsheetRow> getRows()
Description copied from class:SpreadsheetWorksheet
Gets all rows contained by the worksheet- Specified by:
getRows
in classSpreadsheetWorksheet
- Returns:
- List of rows
-
insertRow
public SpreadsheetRow insertRow(java.util.Map<SpreadsheetColumn,java.lang.String> values)
Description copied from class:SpreadsheetWorksheet
Inserts a new row in the worksheet with given values in the given columns.- Specified by:
insertRow
in classSpreadsheetWorksheet
- Returns:
- the newly created row
-
removeRow
public void removeRow(SpreadsheetRow row)
Description copied from class:SpreadsheetWorksheet
Deletes the given row from the actual worksheet.- Specified by:
removeRow
in classSpreadsheetWorksheet
-
getDefaultEmptyCellValue
public java.lang.String getDefaultEmptyCellValue()
Description copied from class:SpreadsheetWorksheet
This method returns the default value to be written to a cell when a new empty row is created in a worksheet that is not enforcing data type strictness.- Specified by:
getDefaultEmptyCellValue
in classSpreadsheetWorksheet
- Returns:
- String
-
getHeaderRowIndex
public int getHeaderRowIndex()
-
getFirstRowIndex
public int getFirstRowIndex()
-
-