public class DataValidatorSpecNodeModel extends DataValidatorNodeModel
Constructor and Description |
---|
DataValidatorSpecNodeModel()
Default Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected DataTableSpec[] |
configure(DataTableSpec[] inSpecs)
This function is called whenever the derived model should re-configure and generate the expected output specs.
|
protected DataValidatorConfiguration |
createConfig() |
protected PortObject[] |
execute(PortObject[] inData,
ExecutionContext exec)
Execute method for general port types.
|
getConfig, loadInternals, loadValidatedSettingsFrom, reset, saveInternals, saveSettingsTo, validateSettings
addWarningListener, computeFinalOutputSpecs, configure, continueLoop, createInitialStreamableOperatorInternals, createMergeOperator, createStreamableOperator, execute, finishStreamableExecution, getAvailableFlowVariables, getAvailableInputFlowVariables, getCredentialsProvider, getInHiLiteHandler, getInPortType, getInputPortRoles, getInteractiveNodeView, getLogger, getLoopEndNode, getLoopStartNode, getNrInPorts, getNrOutPorts, getOutHiLiteHandler, getOutPortType, getOutputPortRoles, getWarningMessage, iterate, notifyViews, notifyWarningListeners, onDispose, peekFlowVariableDouble, peekFlowVariableInt, peekFlowVariableString, pushFlowVariableDouble, pushFlowVariableInt, pushFlowVariableString, removeWarningListener, resetAndConfigureLoopBody, setInHiLiteHandler, setWarningMessage, stateChanged
public DataValidatorSpecNodeModel()
protected DataTableSpec[] configure(DataTableSpec[] inSpecs) throws InvalidSettingsException
For ordinary(*) nodes the passed DataTableSpec elements are never null
but can be empty. The model
may return null
data table spec(s) for the outputs. Note, after the model has been executed this
function will not be called anymore, as the output DataTableSpecs are then being pulled from the output
DataTables. A derived NodeModel
that cannot provide any DataTableSpecs at its outputs before
execution (because the table structure is unknown at this point) can return an array containing just
null
elements. As an example consider a "Transpose" node that flips columns to rows -- there is no
way to determine the table spec at time of configuration as the number of rows (which is the number of new
columns at the output) is unknown though the node is still executable.
(*)For nodes that support optional inputs or may have inactive outputs it's better to override
NodeModel.configure(PortObjectSpec[])
.
Implementation note: This method is called from the NodeModel.configure(PortObjectSpec[])
method unless that
method is overwritten.
configure
in class DataValidatorNodeModel
inSpecs
- The input data table specs (as many as this model has inputs). Do NOT modify the contents of this
array. If no spec is available for any given port (because the port is not connected or the previous
node does not produce a spec) the framework will pass an empty DataTableSpec
(no columns)
unless the port is marked as optional
(in which case the array element
is null).null
DataTableSpec elements are changed to empty once.InvalidSettingsException
- if the #configure()
failed, that is, the settings are inconsistent
with given DataTableSpec elements.protected PortObject[] execute(PortObject[] inData, ExecutionContext exec) throws Exception
inObjects
represent the input objects and the
returned array represents the output objects. The elements in the argument array are generally guaranteed to be
not null and subclasses of the PortObject classes
that are defined through the
PortTypes
given in the constructor
.
Similarly, the returned output objects need to comply with their port types object class (otherwise an error is
reported by the framework) and must not be null. There are few exceptions to these rules:
InactiveBranchConsumer
may find instances of InactiveBranchPortObject
in
case the corresponding input is inactive.InactiveBranchPortObject
elements in case the output should be
inactivated.corresponding flags
.
For a general description of the execute method refer to the description of the specialized
NodeModel.execute(BufferedDataTable[], ExecutionContext)
methods as it addresses more use cases.
execute
in class DataValidatorNodeModel
inData
- The input objects.exec
- For BufferedDataTable
creation and progress.Exception
- If the node execution fails for any reason.protected DataValidatorConfiguration createConfig()
createConfig
in class DataValidatorNodeModel
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.