use of org.knime.core.data.convert.java.DataCellToJavaConverterFactory in project knime-core by knime.
the class InFieldsTable method getInColFields.
/**
* Get the field definitions representing input columns.
*
* @return fields representing input columns.
*/
public InColList getInColFields() {
InColList inCols = new InColList();
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 DataColumnSpec) {
DataColumnSpec colSpec = (DataColumnSpec) value;
InCol inCol = new InCol();
inCol.setKnimeName(colSpec.getName());
inCol.setJavaName((String) m_model.getValueAt(r, Column.JAVA_FIELD));
Object javaTypeObject = m_model.getValueAt(r, Column.JAVA_TYPE);
if (javaTypeObject instanceof DataCellToJavaConverterFactory) {
inCol.setConverterFactory(colSpec.getType(), (DataCellToJavaConverterFactory) javaTypeObject);
} else {
throw new IllegalStateException("Contents of JavaType column need to be DataCellToJavaConverterFactory instances.");
}
inCols.add(inCol);
}
}
return inCols;
}
Aggregations