Class DefaultNodeSettings.DefaultNodeSettingsContext

java.lang.Object
org.knime.core.webui.node.dialog.defaultdialog.DefaultNodeSettings.DefaultNodeSettingsContext
Enclosing interface:
DefaultNodeSettings

public static final class DefaultNodeSettings.DefaultNodeSettingsContext extends Object
A context that holds any available information that might be relevant for creating a new instance of DefaultNodeSettings.
  • 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 PortObjectSpecs of the node; NOTE: array of specs can contain null values, e.g., if input port is not connected!
    • getPortObjectSpec

      public Optional<org.knime.core.node.port.PortObjectSpec> getPortObjectSpec(int portIndex)
      Parameters:
      portIndex - the port for which to retrieve the spec
      Returns:
      the PortObjectSpec at the given portIndex or Optional.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 DataTableSpecs of the node; NOTE: array of specs can contain null values, e.g., if input port is not connected!
      Throws:
      ClassCastException - if any of the node's input ports does not hold a DataTableSpec
    • getDataTableSpec

      public Optional<org.knime.core.data.DataTableSpec> getDataTableSpec(int portIndex)
      Parameters:
      portIndex - the port for which to retrieve the spec
      Returns:
      the DataTableSpec at the given portIndex or Optional.empty() if it is not available
      Throws:
      ClassCastException - if the requested port is not a table port
      IndexOutOfBoundsException - 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 variable
      type - the VariableType of 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 - the VariableTypes of the requested FlowVariables
      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

      public String[] getAvailableFlowVariableNames()
      Returns:
      the names of the available flow variables or an empty array if there are no flow variables available
    • getFlowVariableByName

      public Optional<org.knime.core.node.workflow.FlowVariable> getFlowVariableByName(String name)
      Parameters:
      name - the name of a flow variable
      Returns:
      the associated flow variable if it exists
    • getCredentialsProvider

      public Optional<org.knime.core.node.workflow.CredentialsProvider> getCredentialsProvider()
      Returns:
      the CredentialsProvider associated with the node. Can be empty, e.g., if the node is a component