Class VariableSettings

java.lang.Object
org.knime.core.webui.node.dialog.internal.VariableSettings
All Implemented Interfaces:
VariableSettingsRO, VariableSettingsWO

public final class VariableSettings extends Object implements VariableSettingsWO, VariableSettingsRO
An implementation of VariableSettingsWO that only adds the settings for the variables to the node settings if necessary.
Author:
Benjamin Wilhelm, KNIME GmbH, Konstanz, Germany, Martin Horn, KNIME GmbH, Konstanz, Germany
  • Field Details

    • EXPOSED_VARIABLE_CFG_KEY

      public static final String EXPOSED_VARIABLE_CFG_KEY
      Config key for the exposed variable.
      See Also:
    • USED_VARIABLE_CFG_KEY

      public static final String USED_VARIABLE_CFG_KEY
      Config key for the used variable.
      See Also:
    • USED_VARIABLE_FLAWED_CFG_KEY

      public static final String USED_VARIABLE_FLAWED_CFG_KEY
      Config key for a boolean indicating whether the used variable is flawed in the sense that overriding the corresponding node setting with it will lead to an error.
      See Also:
  • Constructor Details

    • VariableSettings

      public VariableSettings(org.knime.core.node.NodeSettings nodeSettings, SettingsType type)
      Internal use only
      Parameters:
      nodeSettings -
      type -
      Throws:
      org.knime.core.node.InvalidSettingsException
    • VariableSettings

      public VariableSettings(org.knime.core.node.NodeSettings variableSettings, org.knime.core.node.NodeSettings nodeSettings)
      Internal use only
      Parameters:
      variableSettings -
      nodeSettings -
  • Method Details

    • getVariableSettings

      public Optional<org.knime.core.node.NodeSettings> getVariableSettings()
    • getVariableSettingsIterable

      public Iterable<String> getVariableSettingsIterable()
      Specified by:
      getVariableSettingsIterable in interface VariableSettingsRO
      Returns:
      an iterable over all the settings keys at this level
    • isVariableSetting

      public boolean isVariableSetting(String key)
      Description copied from interface: VariableSettingsRO
      Whether the setting for the given key is a 'leaf' in the variable settings tree. I.e. VariableSettingsRO.getUsedVariable(String) and VariableSettingsRO.getExposedVariable(String) can be called without them throwing an InvalidSettingsException . If false VariableSettingsRO.getVariableSettings(String) can be used to further traverse the variable settings tree.
      Specified by:
      isVariableSetting in interface VariableSettingsRO
      Returns:
      true if the setting for the key is a variable setting
    • getVariableSettings

      public VariableSettingsRO getVariableSettings(String key) throws org.knime.core.node.InvalidSettingsException
      Specified by:
      getVariableSettings in interface VariableSettingsRO
      Returns:
      the variable settings subtree for the given key
      Throws:
      org.knime.core.node.InvalidSettingsException - if there is no variable settings subtree for the given key
    • getOrCreateVariableSettings

      public VariableSettingsWO getOrCreateVariableSettings(String key) throws org.knime.core.node.InvalidSettingsException
      Description copied from interface: VariableSettingsWO
      Access the variable settings of a settings group that was added by NodeSettings.addNodeSettings(String). See the class javadoc for an example.
      Specified by:
      getOrCreateVariableSettings in interface VariableSettingsWO
      Parameters:
      key - the key of the child settings
      Returns:
      the child settings
      Throws:
      org.knime.core.node.InvalidSettingsException - if there are no child settings with the given key
    • getUsedVariable

      public String getUsedVariable(String key) throws org.knime.core.node.InvalidSettingsException
      Specified by:
      getUsedVariable in interface VariableSettingsRO
      Returns:
      the name of the variable used or null if none is set
      Throws:
      org.knime.core.node.InvalidSettingsException - if there no variable setting for the given key
    • addUsedVariable

      public void addUsedVariable(String settingsKey, String usedVariable, boolean isControllingFlowVariableFlawed) throws org.knime.core.node.InvalidSettingsException
      Description copied from interface: VariableSettingsWO
      Set that the setting with the given key uses the value of the variable.
      Specified by:
      addUsedVariable in interface VariableSettingsWO
      usedVariable - the name of the variable which should be used
      isControllingFlowVariableFlawed - whether overriding the corresponding setting with this variable in a valid way is currently not possible
      Throws:
      org.knime.core.node.InvalidSettingsException - if there is no setting with the given key
    • getExposedVariable

      public String getExposedVariable(String key) throws org.knime.core.node.InvalidSettingsException
      Specified by:
      getExposedVariable in interface VariableSettingsRO
      Returns:
      the name of the variable exposed or null if none is set
      Throws:
      org.knime.core.node.InvalidSettingsException - if there no variable setting for the given key
    • addExposedVariable

      public void addExposedVariable(String settingsKey, String exposedVariable) throws org.knime.core.node.InvalidSettingsException
      Description copied from interface: VariableSettingsWO
      Set that the setting with the given key is exposed as a variable.
      Specified by:
      addExposedVariable in interface VariableSettingsWO
      exposedVariable - the name of the variable which should be exposed
      Throws:
      org.knime.core.node.InvalidSettingsException - if there is no setting with the given key