Search in sources :

Example 1 with InVarList

use of org.knime.base.node.jsnippet.util.JavaFieldList.InVarList in project knime-core by knime.

the class InFieldsTable method getInVarFields.

/**
 * Get the field definitions representing input flow variables.
 *
 * @return fields representing input flow variables
 */
public InVarList getInVarFields() {
    InVarList inCols = new InVarList();
    for (int r = 0; r < m_model.getRowCount(); r++) {
        if (!m_model.validateValues(r)) {
            // there are errors in this row
            continue;
        }
        Object value = m_model.getValueAt(r, Column.COLUMN);
        if (value instanceof FlowVariable) {
            FlowVariable colSpec = (FlowVariable) value;
            InVar inVar = new InVar();
            inVar.setFlowVarType(colSpec.getType());
            inVar.setKnimeName(colSpec.getName());
            inVar.setJavaName((String) m_model.getValueAt(r, Column.JAVA_FIELD));
            inVar.setJavaType((Class) m_model.getValueAt(r, Column.JAVA_TYPE));
            inCols.add(inVar);
        }
    }
    return inCols;
}
Also used : InVar(org.knime.base.node.jsnippet.util.field.InVar) InVarList(org.knime.base.node.jsnippet.util.JavaFieldList.InVarList) FlowVariable(org.knime.core.node.workflow.FlowVariable)

Aggregations

InVarList (org.knime.base.node.jsnippet.util.JavaFieldList.InVarList)1 InVar (org.knime.base.node.jsnippet.util.field.InVar)1 FlowVariable (org.knime.core.node.workflow.FlowVariable)1