public class ExcelSource extends MatrixSource
| Constructor and Description |
|---|
ExcelSource(String sourceIdentifier,
org.apache.poi.ss.usermodel.Sheet sheet)
Opens a sheet of an excel file as a DataSource.
|
ExcelSource(String sourceIdentifier,
org.apache.poi.ss.usermodel.Sheet sheet,
boolean hasHeader)
Opens a sheet of an excel file as a DataSource.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getData(int index) |
String |
getLineIdentifier()
Returns the line identifier.
|
boolean |
hasNext()
Return true if the data source has more rows.
|
String |
next()
Moves the data source to the next row.
|
String |
reset()
Resets the data source.
|
boolean |
setData(int index,
Object value)
Sets the specified value to the specivied column.
|
boolean |
setData(String column,
Object value)
Return the object at the specified index.
|
getColumns, getData, hasHeadersgetSourceIdentifierclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetData, getData, resetpublic ExcelSource(String sourceIdentifier, org.apache.poi.ss.usermodel.Sheet sheet, boolean hasHeader) throws DataValidationException
sourceIdentifier - the name of this sourcesheet - the excel sheet specified sheet.hasHeader - true when the first line contains the headerDataValidationException - when the header does not contain all
strings.public ExcelSource(String sourceIdentifier, org.apache.poi.ss.usermodel.Sheet sheet)
sourceIdentifier - the name of this sourcesheet - the excel sheet specified sheet.public boolean hasNext()
DataSourcepublic String next()
DataSourcepublic String reset()
DataSourcepublic String getLineIdentifier() throws IllegalSourceStateException
DataSourceIllegalSourceStateException - when the method could not be called
due to the state of the source i.e. next() has not been called or this
method is not supported by the data source. when next() has not beenpublic Object getData(int index) throws IllegalSourceStateException
IllegalSourceStateExceptionpublic boolean setData(String column, Object value) throws Exception
DataSourcesetData in interface DataSourcesetData in interface VariableSourcesetData in class MatrixSourcecolumn - the location where the object should be stored.value - the object to store.Exceptionpublic boolean setData(int index,
Object value)
DataSourceindex - the location where the object should be stored.value - the object to store.Copyright © 2015. All rights reserved.