Class DefaultDialogDataConverterImpl
java.lang.Object
org.knime.core.webui.node.dialog.defaultdialog.DefaultDialogDataConverterImpl
- All Implemented Interfaces:
DefaultDialogDataConverter
public final class DefaultDialogDataConverterImpl
extends Object
implements DefaultDialogDataConverter
The converter used in the
FlowVariableDataServiceImpl of the DefaultNodeDialog.- Author:
- Paul Bärnreuther
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDialogDataConverterImpl(Map<SettingsType, Class<? extends DefaultNodeSettings>> settingsClasses) DefaultDialogDataConverterImpl(SettingsType type, Class<? extends DefaultNodeSettings> settingsClass) Converter for only converting one type of settings. -
Method Summary
Modifier and TypeMethodDescriptionorg.knime.core.node.NodeSettingsdataJsonToNodeSettings(com.fasterxml.jackson.databind.JsonNode root, SettingsType type) Transforms the JSON representation of the data form the front-end to node settings of a certain settings type.com.fasterxml.jackson.databind.JsonNodenodeSettingsToDataJson(SettingsType type, org.knime.core.node.NodeSettingsRO nodeSettings, DefaultNodeSettings.DefaultNodeSettingsContext context) Transforms node settings to the data representation given to the front-end.
-
Constructor Details
-
DefaultDialogDataConverterImpl
public DefaultDialogDataConverterImpl(Map<SettingsType, Class<? extends DefaultNodeSettings>> settingsClasses) - Parameters:
settingsClasses- the classes of theDefaultNodeSettingsassociated to the settings types (model and/or view).
-
DefaultDialogDataConverterImpl
public DefaultDialogDataConverterImpl(SettingsType type, Class<? extends DefaultNodeSettings> settingsClass) Converter for only converting one type of settings. Note that some of its conversion methods might fail when they are used with a different type.- Parameters:
type- the type of the settingssettingsClass- the default node setting of this type
-
-
Method Details
-
dataJsonToNodeSettings
public org.knime.core.node.NodeSettings dataJsonToNodeSettings(com.fasterxml.jackson.databind.JsonNode root, SettingsType type) Transforms the JSON representation of the data form the front-end to node settings of a certain settings type. This is used by theFlowVariableDataServiceImpl- to find out which variables are compatible with which settings by getting the variable types that can
overwrite a setting
(
VariableTypeRegistry.getOverwritingTypes(org.knime.core.node.config.Config, String)). - to overwrite a setting of the
NodeSettingswith a variable and return the overwritten value for displaying it in the frontend.
- Specified by:
dataJsonToNodeSettingsin interfaceDefaultDialogDataConverter- Parameters:
root- the JSON representation of the data. The top level keys are values ofSettingsType.getConfigKey(), i.e. either "model" or "view" and it is given that the key for the given type exists.type- the type of the to be extracted node settings- Returns:
- the node settings of the given type
- to find out which variables are compatible with which settings by getting the variable types that can
overwrite a setting
(
-
nodeSettingsToDataJson
public com.fasterxml.jackson.databind.JsonNode nodeSettingsToDataJson(SettingsType type, org.knime.core.node.NodeSettingsRO nodeSettings, DefaultNodeSettings.DefaultNodeSettingsContext context) throws org.knime.core.node.InvalidSettingsException Transforms node settings to the data representation given to the front-end. This is used by theFlowVariableDataServiceImplto get the value of settings overwritten by flow variables after the user has selected a variable. The value is returned to the frontend and displayed to the user.- Specified by:
nodeSettingsToDataJsonin interfaceDefaultDialogDataConverter- Parameters:
type- the type of settings that is usednodeSettings- the input node settings of the given type- Returns:
- The resulting representation of the data as JSON. Its top level keys have to be values of
SettingsType.getConfigKey()containing the key of the given type. - Throws:
org.knime.core.node.InvalidSettingsException
-