Class ExcelPipelineInput
java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.core.FoundationObject
com.northconcepts.datapipeline.foundations.pipeline.PipelineObject
com.northconcepts.datapipeline.foundations.pipeline.PipelineInput
com.northconcepts.datapipeline.foundations.pipeline.input.FileSourcePipelineInput
com.northconcepts.datapipeline.foundations.pipeline.input.ExcelPipelineInput
- All Implemented Interfaces:
DataExceptionContributor,JsonSerializable,RecordSerializable,XmlSerializable,DataReaderFactory,JavaCodeGenerator,Serializable
Reads a pipeline's source data from a sheet of an Excel
FileSource using an ExcelReader.- See Also:
-
Field Summary
Fields inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
internalId, internalName, log, TIMESTAMP_FORMATFields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromRecord(Record source) Loads this instance's state from a record and returnsthis(for fluid API call chaining).fromXmlElement(Element element) voidAppends Java source code representing this object to the given builder.Returns how a failed formula evaluation is handled (defaults toExcelReader.FailedExpressionStrategy.FAIL).Returns the names given to the fields in column order, overriding any read from the first row (null or empty if unset).intReturns the 0-based index of the last row to read or a negative value to read to the end of the sheet (defaults to -1).getName()Returns a display name for this input, such as the source's name followed by its format.Returns the provider used to read the workbook (defaults toExcelDocument.ProviderType.POI_XSSF).intReturns the 0-based index of the sheet to read when no sheet name is set (defaults to 0).Returns the name of the sheet to read; when blank, the sheet atgetSheetIndex()is read (defaults to null).intReturns the 0-based index of the first column to read (defaults to 0).intReturns the 0-based index of the first row to read (defaults to 0).booleanIndicates if the Excel document is closed when the reader is closed (defaults to false).booleanIndicates if formulas are evaluated and their results read instead of the formula text (defaults to true).booleanIndicates if the first row read holds the field names (defaults to false).booleanIndicates if this input can save data lineage on the records it reads (false unless a subclass overrides it).booleanIndicates if rows whose values are all null or empty are skipped (defaults to false).booleanIndicates if every record gets a field for each column in the sheet, not just its own row's cells (defaults to false).setAutoCloseDocument(boolean autoCloseDocument) Indicates if the Excel document is closed when the reader is closed (defaults to false).setEvaluateExpressions(boolean evaluateExpressions) Indicates if formulas are evaluated and their results read instead of the formula text (defaults to true).setFailedExpressionStrategy(ExcelReader.FailedExpressionStrategy failedExpressionStrategy) Sets how a failed formula evaluation is handled (defaults toExcelReader.FailedExpressionStrategy.FAIL).setFieldNames(String... fieldNames) Sets the names given to the fields in column order, overriding any read from the first row; must not be empty.setFieldNames(Collection<String> fieldNames) Sets the names given to the fields in column order, overriding any read from the first row; must not be empty.setFieldNamesInFirstRow(boolean fieldNamesInFirstRow) Indicates if the first row read holds the field names (defaults to false).setFileSource(FileSource fileSource) setLastRow(int lastRow) Sets the 0-based index of the last row to read or a negative value to read to the end of the sheet (defaults to -1).setProviderType(ExcelDocument.ProviderType providerType) Sets the provider used to read the workbook (defaults toExcelDocument.ProviderType.POI_XSSF).setSaveLineage(boolean saveLineage) Indicates if data lineage (where each record and field came from) is saved on the records read (defaults to false); enabling it throws an exception if lineage is not supported.setSheetIndex(int sheetIndex) Sets the 0-based index of the sheet to read when no sheet name is set (defaults to 0).setSheetName(String sheetName) Sets the name of the sheet to read; when blank, the sheet atgetSheetIndex()is read (defaults to null).setSkipEmptyRows(boolean skipEmptyRows) Indicates if rows whose values are all null or empty are skipped (defaults to false).setStartingColumn(int startingColumn) Sets the 0-based index of the first column to read (defaults to 0).setStartingRow(int startingRow) Sets the 0-based index of the first row to read (defaults to 0).setUseSheetColumnCount(boolean useSheetColumnCount) Indicates if every record gets a field for each column in the sheet, not just its own row's cells (defaults to false).toRecord()Converts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.toXmlElement(Document document) Returns an element, created withdocument, describing this object; the default implementation throws aDataException.Methods inherited from class com.northconcepts.datapipeline.foundations.pipeline.PipelineInput
getNestedPipelineInput, getPipelineInput, getRootPipelineInput, isSaveLineageMethods inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
addExceptionProperties, assertValid, assertValid, clone, exception, exception, exception, getInternalId, getInternalName, resetInternalIdMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.northconcepts.datapipeline.core.DataExceptionContributor
addExceptionProperties
-
Constructor Details
-
ExcelPipelineInput
public ExcelPipelineInput()
-
-
Method Details
-
getName
Description copied from class:PipelineInputReturns a display name for this input, such as the source's name followed by its format.- Overrides:
getNamein classFileSourcePipelineInput
-
isLineageSupported
public boolean isLineageSupported()Description copied from class:PipelineInputIndicates if this input can save data lineage on the records it reads (false unless a subclass overrides it).- Overrides:
isLineageSupportedin classPipelineInput
-
setSaveLineage
Description copied from class:PipelineInputIndicates if data lineage (where each record and field came from) is saved on the records read (defaults to false); enabling it throws an exception if lineage is not supported.- Overrides:
setSaveLineagein classPipelineInput
-
toRecord
Description copied from interface:RecordSerializableConverts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.- Specified by:
toRecordin interfaceRecordSerializable- Overrides:
toRecordin classPipelineInput
-
fromRecord
Description copied from interface:RecordSerializableLoads this instance's state from a record and returnsthis(for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.- Specified by:
fromRecordin interfaceRecordSerializable- Overrides:
fromRecordin classPipelineInput- Parameters:
source-- Returns:
- this instance.
-
getFileSource
- Specified by:
getFileSourcein classFileSourcePipelineInput
-
setFileSource
- Specified by:
setFileSourcein classFileSourcePipelineInput
-
getProviderType
Returns the provider used to read the workbook (defaults toExcelDocument.ProviderType.POI_XSSF). -
setProviderType
Sets the provider used to read the workbook (defaults toExcelDocument.ProviderType.POI_XSSF). -
getSheetName
Returns the name of the sheet to read; when blank, the sheet atgetSheetIndex()is read (defaults to null). -
setSheetName
Sets the name of the sheet to read; when blank, the sheet atgetSheetIndex()is read (defaults to null). -
getSheetIndex
public int getSheetIndex()Returns the 0-based index of the sheet to read when no sheet name is set (defaults to 0). -
setSheetIndex
Sets the 0-based index of the sheet to read when no sheet name is set (defaults to 0). -
getStartingRow
public int getStartingRow()Returns the 0-based index of the first row to read (defaults to 0). -
setStartingRow
Sets the 0-based index of the first row to read (defaults to 0). -
getLastRow
public int getLastRow()Returns the 0-based index of the last row to read or a negative value to read to the end of the sheet (defaults to -1). -
setLastRow
Sets the 0-based index of the last row to read or a negative value to read to the end of the sheet (defaults to -1). -
getStartingColumn
public int getStartingColumn()Returns the 0-based index of the first column to read (defaults to 0). -
setStartingColumn
Sets the 0-based index of the first column to read (defaults to 0). -
isSkipEmptyRows
public boolean isSkipEmptyRows()Indicates if rows whose values are all null or empty are skipped (defaults to false). -
setSkipEmptyRows
Indicates if rows whose values are all null or empty are skipped (defaults to false). -
isFieldNamesInFirstRow
public boolean isFieldNamesInFirstRow()Indicates if the first row read holds the field names (defaults to false). -
setFieldNamesInFirstRow
Indicates if the first row read holds the field names (defaults to false). -
isEvaluateExpressions
public boolean isEvaluateExpressions()Indicates if formulas are evaluated and their results read instead of the formula text (defaults to true). -
setEvaluateExpressions
Indicates if formulas are evaluated and their results read instead of the formula text (defaults to true). -
getFailedExpressionStrategy
Returns how a failed formula evaluation is handled (defaults toExcelReader.FailedExpressionStrategy.FAIL). -
setFailedExpressionStrategy
public ExcelPipelineInput setFailedExpressionStrategy(ExcelReader.FailedExpressionStrategy failedExpressionStrategy) Sets how a failed formula evaluation is handled (defaults toExcelReader.FailedExpressionStrategy.FAIL). -
isUseSheetColumnCount
public boolean isUseSheetColumnCount()Indicates if every record gets a field for each column in the sheet, not just its own row's cells (defaults to false). -
setUseSheetColumnCount
Indicates if every record gets a field for each column in the sheet, not just its own row's cells (defaults to false). -
isAutoCloseDocument
public boolean isAutoCloseDocument()Indicates if the Excel document is closed when the reader is closed (defaults to false). -
setAutoCloseDocument
Indicates if the Excel document is closed when the reader is closed (defaults to false). -
getFieldNames
Returns the names given to the fields in column order, overriding any read from the first row (null or empty if unset). -
setFieldNames
Sets the names given to the fields in column order, overriding any read from the first row; must not be empty. -
setFieldNames
Sets the names given to the fields in column order, overriding any read from the first row; must not be empty. -
createDataReader
-
generateJavaCode
Description copied from interface:JavaCodeGeneratorAppends Java source code representing this object to the given builder. -
toXmlElement
Description copied from interface:XmlSerializableReturns an element, created withdocument, describing this object; the default implementation throws aDataException.- Specified by:
toXmlElementin interfaceXmlSerializable- Overrides:
toXmlElementin classPipelineInput
-
fromXmlElement
- Specified by:
fromXmlElementin interfaceXmlSerializable- Overrides:
fromXmlElementin classPipelineInput
-