public class FixedWidthFRPreviewTable extends FixedWidthFRTable
FileTable
) because if settings are not correct yet, the table in the preview must
not throw any exception on unexpected or invalid data it reads (which the "normal" file table does). Thus, this table
returns a row iterator that will create an error row when a error occurs during file reading. It will end the table
after the erroneous element was read.Constructor and Description |
---|
FixedWidthFRPreviewTable(DataTableSpec tableSpec,
FixedWidthFRSettings settings,
ExecutionContext exec)
Creates a new table, its like the "normal"
FileTable , just not failing on invalid data files. |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addChangeListener(ChangeListener listener)
If someone wants to be notified if an error occurred he should register through this method.
|
protected CloseableRowIterator |
createRowIterator(FixedWidthFRSettings nodeSettings,
DataTableSpec tableSpec,
ExecutionContext exec) |
DataTableSpec |
getDataTableSpec()
Returns the
DataTableSpec object of this table which gives
information about the structure of this data table. |
(package private) String |
getErrorDetail() |
(package private) String |
getErrorMsg() |
(package private) boolean |
getErrorOccurred() |
(package private) void |
removeAllChangeListeners()
Clears the list of change listeners.
|
(package private) void |
setError(FileReaderException fre)
This sets the flag indicating that the row iterator ended the table with an error.
|
close, iterator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
FixedWidthFRPreviewTable(DataTableSpec tableSpec, FixedWidthFRSettings settings, ExecutionContext exec)
FileTable
, just not failing on invalid data files.settings
- settings for the underlying FileTable
tableSpec
- table spec for the underlying FileTable
exec
- the execution context the progress is reported toFileTable
protected CloseableRowIterator createRowIterator(FixedWidthFRSettings nodeSettings, DataTableSpec tableSpec, ExecutionContext exec) throws IOException
createRowIterator
in class FixedWidthFRTable
nodeSettings
- the node settingstableSpec
- the tableSpecexec
- the execution contextIOException
- if buffered file reader can't be createdpublic DataTableSpec getDataTableSpec()
DataTableSpec
object of this table which gives
information about the structure of this data table.getDataTableSpec
in interface DataTable
getDataTableSpec
in class FixedWidthFRTable
void setError(FileReaderException fre)
fre
- the exception thrown by the error.boolean getErrorOccurred()
true
if an error occurred in an underlying row iterator. Meaning the table contains invalid
data. NOTE: if false
is returned it is not guaranteed that all data in the table is valid.
It could be that no row iterator reached the invalid data yet.String getErrorMsg()
null
if
not set.String getErrorDetail()
void addChangeListener(ChangeListener listener)
listener
- the object being notified when an error occurs.void removeAllChangeListeners()
addChangeListener(ChangeListener)
KNIME GmbH, Konstanz, Germany
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.