Search in sources :

Example 1 with NodeDescription

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

the class MissingValueHandlerNodeFactory method createNodeDescription.

/**
 * {@inheritDoc}
 */
@Override
protected NodeDescription createNodeDescription() throws SAXException, IOException, XmlException {
    NodeDescription createNodeDescription = super.createNodeDescription();
    MissingCellHandlerFactoryManager manager = MissingCellHandlerFactoryManager.getInstance();
    return MissingValueNodeDescriptionHelper.createNodeDescription(createNodeDescription, manager);
}
Also used : NodeDescription(org.knime.core.node.NodeDescription) MissingCellHandlerFactoryManager(org.knime.base.node.preproc.pmml.missingval.MissingCellHandlerFactoryManager)

Example 2 with NodeDescription

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

the class MissingValueNodeDescriptionHelper method createNodeDescription.

/**
 * Adds an additional option tag with name "Missing Value Handler Selection"
 * to the fullDescription of the given node
 * description.
 *
 * @param parentDescription the parent description to add the tag to
 * @param manager handler factory manager
 * @return a node description with the <option=''/> added
 * @throws IOException some problem on reading the description
 * @throws SAXException not going to happen
 */
public static NodeDescription createNodeDescription(final NodeDescription parentDescription, final MissingCellHandlerFactoryManager manager) throws SAXException, IOException {
    NodeDescription createNodeDescription = parentDescription;
    Element knimeNode = createNodeDescription.getXMLDescription();
    List<MissingCellHandlerFactory> factories = manager.getFactories();
    factories.sort((a, b) -> a.getDisplayName().compareTo(b.getDisplayName()));
    Element fullDescription = findFullDescription(knimeNode);
    if (fullDescription != null) {
        MissingCellHandlerDescriptionFactory.addShortDescriptionToNodeDescription(fullDescription, factories);
        // with the namespaces and the following xslt transformation
        return new NodeDescriptionXmlProxy(createNodeDescription, deepCopy(knimeNode));
    }
    return createNodeDescription;
}
Also used : NodeDescription(org.knime.core.node.NodeDescription) MissingCellHandlerFactory(org.knime.base.node.preproc.pmml.missingval.MissingCellHandlerFactory) Element(org.w3c.dom.Element)

Aggregations

NodeDescription (org.knime.core.node.NodeDescription)2 MissingCellHandlerFactory (org.knime.base.node.preproc.pmml.missingval.MissingCellHandlerFactory)1 MissingCellHandlerFactoryManager (org.knime.base.node.preproc.pmml.missingval.MissingCellHandlerFactoryManager)1 Element (org.w3c.dom.Element)1