use of org.knime.core.node.config.base.AbstractConfigEntry in project knime-core by knime.
the class NodeContainerProperties method getPropertyValue.
/**
* {@inheritDoc}
*/
@Override
public Object getPropertyValue(final Object id) {
if (id instanceof String) {
String hierID = (String) id;
// cut off our prefix from the ID
if (!hierID.startsWith(m_prefix)) {
return "ERROR: Unexpected property id: " + hierID + " (while in sub-config " + m_prefix + ")";
}
String ourID = hierID;
if (!m_prefix.isEmpty()) {
assert hierID.charAt(m_prefix.length()) == CONFIG_SEPARATOR.charAt(0);
// + 1 for removing the separator
ourID = hierID.substring(m_prefix.length() + 1);
}
AbstractConfigEntry entry = m_settings.getEntry(ourID);
if (entry instanceof Config) {
return new NodeContainerProperties(getNode(), (Config) entry, m_prefix.isEmpty() ? ourID : m_prefix + CONFIG_SEPARATOR + ourID);
} else {
if (entry == null) {
return "ERROR: No value for key " + ourID;
}
return TokenizerSettings.printableStr(entry.toStringValue());
}
}
return null;
}
Aggregations