use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class RenameNodeModel method saveSettingsTo.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) {
if (m_config != null) {
final NodeSettingsWO subSettings = settings.addNodeSettings(CFG_SUB_CONFIG);
m_config.save(subSettings);
}
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class ColumnAggregatorNodeModel method saveSettingsTo.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) {
m_aggregationCols.saveSettingsTo(settings);
m_removeRetainedCols.saveSettingsTo(settings);
m_removeAggregationCols.saveSettingsTo(settings);
m_valueDelimiter.saveSettingsTo(settings);
m_maxUniqueValues.saveSettingsTo(settings);
final NodeSettingsWO subSettings = settings.addNodeSettings(CFG_AGGREGATION_METHODS);
NamedAggregationOperator.saveMethods(subSettings, m_methods);
m_version.saveSettingsTo(settings);
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class DBDataTypeAggregationFunctionRow method saveFunctions.
/**
* @param settings {@link NodeSettingsWO}
* @param key the config key
* @param rows the {@link DBDataTypeAggregationFunctionRow}s to save
*/
public static void saveFunctions(final NodeSettingsWO settings, final String key, final List<DBDataTypeAggregationFunctionRow> rows) {
if (key == null || key.isEmpty()) {
throw new IllegalArgumentException("key must not be empty");
}
if (settings == null) {
throw new NullPointerException("settings must not be null");
}
if (rows == null) {
return;
}
final NodeSettingsWO root = settings.addNodeSettings(key);
for (int i = 0, length = rows.size(); i < length; i++) {
final NodeSettingsWO cfg = root.addNodeSettings("f_" + i);
final DBDataTypeAggregationFunctionRow row = rows.get(i);
cfg.addDataType(CNFG_DATA_TYPE, row.getDataType());
AbstractDBAggregationFunctionRow.saveFunction(cfg, row.getFunction());
}
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class DBNumericBinnerNodeModel method saveSettingsTo.
/**
* {@inheritDoc}
*/
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) {
for (String columnKey : m_columnToBins.keySet()) {
NodeSettingsWO column = settings.addNodeSettings(columnKey);
if (m_columnToAppended.get(columnKey) != null) {
settings.addString(columnKey + IS_APPENDED, m_columnToAppended.get(columnKey));
} else {
settings.addString(columnKey + IS_APPENDED, null);
}
Bin[] bins = m_columnToBins.get(columnKey);
for (int b = 0; b < bins.length; b++) {
NodeSettingsWO bin = column.addNodeSettings(bins[b].getBinName() + "_" + b);
bins[b].saveToSettings(bin);
}
}
settings.addStringArray(NUMERIC_COLUMNS, m_columnToAppended.keySet().toArray(new String[0]));
}
use of org.knime.core.node.NodeSettingsWO in project knime-core by knime.
the class AbstractDBAggregationFunctionRow method saveFunction.
/**
* @param cfg {@link NodeSettingsWO} to write to
* @param function the {@link AggregationFunction} to save
*/
public static void saveFunction(final NodeSettingsWO cfg, final AggregationFunction function) {
cfg.addString(CNFG_AGGR_COL_SECTION, function.getId());
if (function.hasOptionalSettings()) {
try {
final NodeSettingsWO subConfig = cfg.addNodeSettings("functionSettings");
function.saveSettingsTo(subConfig);
} catch (Exception e) {
LOGGER.error("Exception while saving settings for aggreation function '" + function.getId() + "', reason: " + e.getMessage());
}
}
}
Aggregations