Class DefaultNodeSettings.DefaultNodeSettingsContext
java.lang.Object
org.knime.core.webui.node.dialog.defaultdialog.DefaultNodeSettings.DefaultNodeSettingsContext
- Enclosing interface:
- DefaultNodeSettings
A context that holds any available information that might be relevant for creating a new instance of
DefaultNodeSettings.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultNodeSettingsContext(org.knime.core.node.port.PortObjectSpec[] specs, org.knime.core.node.workflow.FlowObjectStack stack, org.knime.core.node.workflow.CredentialsProvider credentialsProvider) -
Method Summary
Modifier and TypeMethodDescriptionString[]getAvailableInputFlowVariables(org.knime.core.node.workflow.VariableType<?>... types) Optional<org.knime.core.node.workflow.CredentialsProvider>Optional<org.knime.core.data.DataTableSpec>getDataTableSpec(int portIndex) org.knime.core.data.DataTableSpec[]Optional<org.knime.core.node.workflow.FlowVariable>getFlowVariableByName(String name) Optional<org.knime.core.node.port.PortObjectSpec>getPortObjectSpec(int portIndex) org.knime.core.node.port.PortObjectSpec[]<T> Optional<T>peekFlowVariable(String name, org.knime.core.node.workflow.VariableType<T> type)
-
Constructor Details
-
DefaultNodeSettingsContext
public DefaultNodeSettingsContext(org.knime.core.node.port.PortObjectSpec[] specs, org.knime.core.node.workflow.FlowObjectStack stack, org.knime.core.node.workflow.CredentialsProvider credentialsProvider)
-
-
Method Details
-
getPortObjectSpecs
public org.knime.core.node.port.PortObjectSpec[] getPortObjectSpecs()- Returns:
- the input
PortObjectSpecsof the node; NOTE: array of specs can containnullvalues, e.g., if input port is not connected!
-
getPortObjectSpec
- Parameters:
portIndex- the port for which to retrieve the spec- Returns:
- the
PortObjectSpecat the given portIndex orOptional.empty()if it is not available - Throws:
IndexOutOfBoundsException- if the portIndex does not match the ports of the node
-
getDataTableSpecs
public org.knime.core.data.DataTableSpec[] getDataTableSpecs()- Returns:
- the input
DataTableSpecsof the node; NOTE: array of specs can containnullvalues, e.g., if input port is not connected! - Throws:
ClassCastException- if any of the node's input ports does not hold aDataTableSpec
-
getDataTableSpec
- Parameters:
portIndex- the port for which to retrieve the spec- Returns:
- the
DataTableSpecat the given portIndex orOptional.empty()if it is not available - Throws:
ClassCastException- if the requested port is not a table portIndexOutOfBoundsException- if the portIndex does not match the ports of the node
-
peekFlowVariable
public <T> Optional<T> peekFlowVariable(String name, org.knime.core.node.workflow.VariableType<T> type) - Type Parameters:
T- the simple value type of the variable- Parameters:
name- the name of the variabletype- theVariableTypeof the variable- Returns:
- the simple non-null value of the top-most variable with the argument name and type, if present,
otherwise an empty
Optional - Throws:
NullPointerException- if any argument is null- See Also:
-
FlowObjectStack.peekFlowVariable(String, VariableType)
-
getAvailableInputFlowVariables
public Map<String,org.knime.core.node.workflow.FlowVariable> getAvailableInputFlowVariables(org.knime.core.node.workflow.VariableType<?>... types) - Parameters:
types- theVariableTypesof the requestedFlowVariables- Returns:
- the non-null read-only map of flow variable name ->
FlowVariable - Throws:
NullPointerException- if the argument is null- See Also:
-
FlowObjectStack.getAvailableFlowVariables(VariableType[])
-
getAvailableFlowVariableNames
- Returns:
- the names of the available flow variables or an empty array if there are no flow variables available
-
getFlowVariableByName
- Parameters:
name- the name of a flow variable- Returns:
- the associated flow variable if it exists
-
getCredentialsProvider
- Returns:
- the
CredentialsProviderassociated with the node. Can be empty, e.g., if the node is a component
-