use of org.knime.core.node.NodeFactory in project knime-core by knime.
the class TableSorterTest method setUp.
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
NodeFactory<NodeModel> dummyFactory = (NodeFactory) new VirtualParallelizedChunkPortObjectInNodeFactory(new PortType[0]);
m_exec = new ExecutionContext(new DefaultNodeProgressMonitor(), new Node(dummyFactory), SingleNodeContainer.MemoryPolicy.CacheOnDisc, new HashMap<Integer, ContainerTable>());
}
use of org.knime.core.node.NodeFactory in project knime-core by knime.
the class FileNativeNodeContainerPersistor method loadNodeFactory.
/**
* Creates the node factory instance for the given fully-qualified factory class name.
* Otherwise a respective exception will be thrown.
*
* @since 3.5
*/
@SuppressWarnings("unchecked")
public static final NodeFactory<NodeModel> loadNodeFactory(final String factoryClassName) throws InvalidSettingsException, InstantiationException, IllegalAccessException, InvalidNodeFactoryExtensionException {
Optional<NodeFactory<? extends NodeModel>> facOptional = NodeFactoryExtensionManager.getInstance().createNodeFactory(factoryClassName);
if (facOptional.isPresent()) {
return (NodeFactory<NodeModel>) facOptional.get();
}
List<NodeFactoryClassMapper> classMapperList = NodeFactoryClassMapper.getRegisteredMappers();
for (NodeFactoryClassMapper mapper : classMapperList) {
@SuppressWarnings("rawtypes") NodeFactory factory = mapper.mapFactoryClassName(factoryClassName);
if (factory != null) {
LOGGER.debug(String.format("Replacing stored factory class name \"%s\" by actual factory " + "class \"%s\" (defined by class mapper \"%s\")", factoryClassName, factory.getClass().getName(), mapper.getClass().getName()));
return factory;
}
}
throw new InvalidSettingsException(String.format("Unknown factory class \"%s\" -- not registered via extension point", factoryClassName));
}
Aggregations