use of org.knime.core.node.NodeSettings in project knime-core by knime.
the class SingleNodeContainer method saveNodeSettingsToDefault.
/**
* Implementation of {@link WorkflowManager#saveNodeSettingsToDefault(NodeID)}.
*/
void saveNodeSettingsToDefault() {
NodeSettings modelSettings = new NodeSettings("model");
NodeContext.pushContext(this);
try {
performSaveModelSettingsTo(modelSettings);
} finally {
NodeContext.removeLastContext();
}
m_settings.setModelSettings(modelSettings);
}
use of org.knime.core.node.NodeSettings in project knime-core by knime.
the class DBPivotNodeModel method loadValidatedSettingsFrom.
/**
* {@inheritDoc}
*/
@Override
protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
super.loadValidatedSettingsFrom(settings);
m_groupByCols.loadSettingsFrom(settings);
m_pivotCols.loadSettingsFrom(settings);
m_columnNamePolicy.loadSettingsFrom(settings);
m_settings = new NodeSettings("copy");
settings.copyTo(m_settings);
}
use of org.knime.core.node.NodeSettings in project knime-core by knime.
the class ReadSysPropertyNodeModel method configure.
/**
* {@inheritDoc}
*/
@Override
protected DataTableSpec[] configure(final DataTableSpec[] inSpecs) throws InvalidSettingsException {
if (m_config == null) {
m_config = new ReadSysPropertyConfiguration();
m_config.loadSettingsNoFail(new NodeSettings("empty"));
setWarningMessage("Auto-configuration: " + "extracting all available properties");
}
Result result = m_config.createResult();
String message = result.getWarningMessage();
if (message != null) {
setWarningMessage(message);
}
DataTable table = result.getTable();
return new DataTableSpec[] { table.getDataTableSpec() };
}
use of org.knime.core.node.NodeSettings in project knime-core by knime.
the class Statistics2NodeModel method saveInternals.
/**
* {@inheritDoc}
*/
@Override
protected void saveInternals(final File internDir, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
NodeSettings sett = new NodeSettings("statistic.xml.gz");
m_statTable.save(sett);
sett.saveToXML(new FileOutputStream(new File(internDir, sett.getKey())));
}
use of org.knime.core.node.NodeSettings in project knime-core by knime.
the class AggregationOperator method equals.
/**
* {@inheritDoc}
*/
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
AggregationOperator other = (AggregationOperator) obj;
if (m_operatorData == null) {
if (other.m_operatorData != null) {
return false;
}
} else if (!m_operatorData.equals(other.m_operatorData)) {
return false;
}
if (m_globalSettings == null) {
if (other.m_globalSettings != null) {
return false;
}
} else if (!m_globalSettings.equals(other.m_globalSettings)) {
return false;
}
if (m_opColSettings == null) {
if (other.m_opColSettings != null) {
return false;
}
} else if (!m_opColSettings.equals(other.m_opColSettings)) {
return false;
}
if (m_skipMsg == null) {
if (other.m_skipMsg != null) {
return false;
}
} else if (!m_skipMsg.equals(other.m_skipMsg)) {
return false;
}
if (m_skipped != other.m_skipped) {
return false;
}
if (other.hasOptionalSettings()) {
if (hasOptionalSettings()) {
// check the optional settings as well
// USE THE SAME KEY FOR BOTH SETTINGS!
final String key = "key";
final NodeSettings s1 = new NodeSettings(key);
other.saveSettingsTo(s1);
final NodeSettings s2 = new NodeSettings(key);
saveSettingsTo(s2);
return s1.equals(s2);
} else {
return true;
}
}
return true;
}
Aggregations