Search in sources :

Example 1 with NodeSettingsWO

use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.

the class MetaNodeTemplateInformation method save.

/**
 * Saves this object to the argument settings.
 * @param settings To save to.
 */
public void save(final NodeSettingsWO settings) {
    if (!Role.None.equals(m_role)) {
        NodeSettingsWO nestedSettings = settings.addNodeSettings(CFG_TEMPLATE_INFO);
        nestedSettings.addString("role", m_role.name());
        String dateS = getTimeStampString();
        nestedSettings.addString("timestamp", dateS);
        String uriS = m_sourceURI == null ? null : m_sourceURI.toString();
        nestedSettings.addString("sourceURI", uriS);
        if (Role.Template.equals(m_role)) {
            nestedSettings.addString("templateType", m_type.name());
        }
    }
}
Also used : NodeSettingsWO(org.knime.core.node.NodeSettingsWO)

Example 2 with NodeSettingsWO

use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.

the class JavaSnippetTemplate method saveSettings.

/**
 * Saves current parameters to settings object.
 * @param settings To save to.
 */
@Override
public void saveSettings(final NodeSettingsWO settings) {
    settings.addString(META_CATEGORY, m_metaCategory.getName());
    settings.addString(CATEGORY, m_category);
    settings.addString(NAME, m_name);
    settings.addString(DESCRIPTION, m_description);
    settings.addString(VERSION, m_version);
    NodeSettingsWO snippet = settings.addNodeSettings(SNIPPET);
    m_snippetSettings.saveSettings(snippet);
}
Also used : NodeSettingsWO(org.knime.core.node.NodeSettingsWO)

Example 3 with NodeSettingsWO

use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.

the class TimeMissingValueHandlingColSetting method saveMetaColSettings.

/**
 * Saves the meta settings to a config object.
 *
 * @param colSettings the settings to write, may include individual settings (ignored)
 * @param settings to write to
 */
static void saveMetaColSettings(final TimeMissingValueHandlingColSetting[] colSettings, final NodeSettingsWO settings) {
    NodeSettingsWO defaults = settings.addNodeSettings(CFG_META);
    for (int i = 0; i < colSettings.length; i++) {
        if (!colSettings[i].isMetaConfig()) {
            continue;
        }
        ConfigType type = colSettings[i].getType();
        String id;
        switch(type) {
            case NON_NUMERICAL:
                id = CFG_META_NUMERICAL;
                break;
            case NUMERICAL:
                id = CFG_META_NON_NUMERICAL;
                break;
            default:
                assert false;
                id = CFG_META_NUMERICAL;
        }
        NodeSettingsWO subConfig = defaults.addNodeSettings(id);
        colSettings[i].saveSettings(subConfig);
    }
}
Also used : NodeSettingsWO(org.knime.core.node.NodeSettingsWO)

Example 4 with NodeSettingsWO

use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.

the class AppendVariableToTableSettings method saveSettingsTo.

/**
 * @param settings to save to.
 */
public void saveSettingsTo(final NodeSettingsWO settings) {
    settings.addBoolean("all", m_includeAll);
    NodeSettingsWO sub = settings.addNodeSettings("variables");
    for (Pair<String, FlowVariable.Type> v : m_variablesOfInterest) {
        NodeSettingsWO sub2 = sub.addNodeSettings(v.getFirst());
        sub2.addString("name", v.getFirst());
        sub2.addString("type", v.getSecond().name());
    }
}
Also used : NodeSettingsWO(org.knime.core.node.NodeSettingsWO)

Example 5 with NodeSettingsWO

use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.

the class VariableToTableSettings method saveSettingsTo.

/**
 * @param settings to save to.
 */
public void saveSettingsTo(final NodeSettingsWO settings) {
    settings.addBoolean("all", m_includeAll);
    NodeSettingsWO sub = settings.addNodeSettings("variables");
    for (Pair<String, FlowVariable.Type> v : m_variablesOfInterest) {
        NodeSettingsWO sub2 = sub.addNodeSettings(v.getFirst());
        sub2.addString("name", v.getFirst());
        sub2.addString("type", v.getSecond().name());
    }
}
Also used : NodeSettingsWO(org.knime.core.node.NodeSettingsWO)

Aggregations

NodeSettingsWO (org.knime.core.node.NodeSettingsWO)125 NodeSettings (org.knime.core.node.NodeSettings)21 Map (java.util.Map)12 File (java.io.File)11 FileOutputStream (java.io.FileOutputStream)9 HashMap (java.util.HashMap)9 LinkedHashMap (java.util.LinkedHashMap)9 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)9 RowKey (org.knime.core.data.RowKey)6 BufferedOutputStream (java.io.BufferedOutputStream)5 DataCell (org.knime.core.data.DataCell)5 ExecutionMonitor (org.knime.core.node.ExecutionMonitor)5 NodeSettingsRO (org.knime.core.node.NodeSettingsRO)5 DataRow (org.knime.core.data.DataRow)4 OutputStream (java.io.OutputStream)3 HashSet (java.util.HashSet)3 LinkedHashSet (java.util.LinkedHashSet)3 GZIPOutputStream (java.util.zip.GZIPOutputStream)3 DataColumnSpec (org.knime.core.data.DataColumnSpec)3 DataType (org.knime.core.data.DataType)3