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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConfig key for the exposed variable.static final StringConfig key for the used variable.static final StringConfig 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. -
Constructor Summary
ConstructorsConstructorDescriptionVariableSettings(org.knime.core.node.NodeSettings variableSettings, org.knime.core.node.NodeSettings nodeSettings) Internal use onlyVariableSettings(org.knime.core.node.NodeSettings nodeSettings, SettingsType type) Internal use only -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExposedVariable(String settingsKey, String exposedVariable) Set that the setting with the given key is exposed as a variable.voidaddUsedVariable(String settingsKey, String usedVariable, boolean isControllingFlowVariableFlawed) Set that the setting with the given key uses the value of the variable.getExposedVariable(String key) Access the variable settings of a settings group that was added byNodeSettings.addNodeSettings(String).getUsedVariable(String key) Optional<org.knime.core.node.NodeSettings>booleanisVariableSetting(String key) Whether the setting for the given key is a 'leaf' in the variable settings tree.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.knime.core.webui.node.dialog.VariableSettingsWO
addUsedVariable
-
Field Details
-
EXPOSED_VARIABLE_CFG_KEY
Config key for the exposed variable.- See Also:
-
USED_VARIABLE_CFG_KEY
Config key for the used variable.- See Also:
-
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
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
-
getVariableSettingsIterable
- Specified by:
getVariableSettingsIterablein interfaceVariableSettingsRO- Returns:
- an iterable over all the settings keys at this level
-
isVariableSetting
Description copied from interface:VariableSettingsROWhether the setting for the given key is a 'leaf' in the variable settings tree. I.e.VariableSettingsRO.getUsedVariable(String)andVariableSettingsRO.getExposedVariable(String)can be called without them throwing anInvalidSettingsException. IffalseVariableSettingsRO.getVariableSettings(String)can be used to further traverse the variable settings tree.- Specified by:
isVariableSettingin interfaceVariableSettingsRO- Returns:
trueif the setting for the key is a variable setting
-
getVariableSettings
public VariableSettingsRO getVariableSettings(String key) throws org.knime.core.node.InvalidSettingsException - Specified by:
getVariableSettingsin interfaceVariableSettingsRO- 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:VariableSettingsWOAccess the variable settings of a settings group that was added byNodeSettings.addNodeSettings(String). See the class javadoc for an example.- Specified by:
getOrCreateVariableSettingsin interfaceVariableSettingsWO- 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
- Specified by:
getUsedVariablein interfaceVariableSettingsRO- Returns:
- the name of the variable used or
nullif 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:VariableSettingsWOSet that the setting with the given key uses the value of the variable.- Specified by:
addUsedVariablein interfaceVariableSettingsWOusedVariable- the name of the variable which should be usedisControllingFlowVariableFlawed- 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
- Specified by:
getExposedVariablein interfaceVariableSettingsRO- Returns:
- the name of the variable exposed or
nullif 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:VariableSettingsWOSet that the setting with the given key is exposed as a variable.- Specified by:
addExposedVariablein interfaceVariableSettingsWOexposedVariable- the name of the variable which should be exposed- Throws:
org.knime.core.node.InvalidSettingsException- if there is no setting with the given key
-