Interface NodeWrapper

All Known Subinterfaces:
NodePortWrapper

public interface NodeWrapper
Wrapper for a node (NodeContainer). The only purpose is to be able to represent a node and optionally something else together with that node (e.g. a node and a port idx) at the same time such that the AbstractNodeUIManager can operate on both (e.g. node and port). Implementations must also implement the #equals(Object) and #hashCode() methods.
Author:
Martin Horn, KNIME GmbH, Konstanz, Germany
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Implemented by NodeFactories in order to provide a custom node-wrapper-type-id as returned by getNodeWrapperTypeId().
  • Method Summary

    Modifier and Type
    Method
    Description
    org.knime.core.node.workflow.NodeContainer
    get()
     
     
    <T> T
    getWithContext(Supplier<T> supplier)
    Runs an operation within the context 'compatible' with this node wrapper (e.g.
    of(org.knime.core.node.workflow.NodeContainer nc)
    Convenience method to create a NodeWrapper-instance.
  • Method Details

    • get

      org.knime.core.node.workflow.NodeContainer get()
      Returns:
      the wrapped node
    • getNodeWrapperTypeId

      String getNodeWrapperTypeId()
      Returns:
      a id representing the type of the node wrapper (which is independent from the node wrapper-instance). E.g. the node type (~'data generator') or the port type (~'table').
    • getWithContext

      <T> T getWithContext(Supplier<T> supplier)
      Runs an operation within the context 'compatible' with this node wrapper (e.g. NodeContext or PortContext)
      Type Parameters:
      T -
      Parameters:
      supplier - the operation to run
      Returns:
      the object the supplier returns
    • of

      static NodeWrapper of(org.knime.core.node.workflow.NodeContainer nc)
      Convenience method to create a NodeWrapper-instance.
      Parameters:
      nc -
      Returns:
      a new instance