use of org.knime.core.data.util.DataTableSpecExtractor in project knime-core by knime.
the class ExtractTableSpecNodeModel method getExtractedDataTable.
/**
* Creates a data table with the meta information extracted from the given
* spec as data rows/cols.
*
* @param spec The table spec to extract the meta information from.
* @return The data table containing the meta information from the given
* spec.
*/
private DataTable getExtractedDataTable(final DataTableSpec spec) {
DataTableSpecExtractor extractor = new DataTableSpecExtractor();
extractor.setPossibleValueOutputFormat(m_possibleValuesAsCollection.getBooleanValue() ? PossibleValueOutputFormat.Collection : PossibleValueOutputFormat.Hide);
extractor.setPropertyHandlerOutputFormat(m_extractPropertyHandlersModel.getBooleanValue() ? PropertyHandlerOutputFormat.Boolean : PropertyHandlerOutputFormat.Hide);
return extractor.extract(spec);
}
use of org.knime.core.data.util.DataTableSpecExtractor in project knime-core by knime.
the class DataTableSpecView method createTableSpecTable.
private DataTable createTableSpecTable(final DataTableSpec spec) {
if (spec != null) {
DataTableSpecExtractor e = new DataTableSpecExtractor();
e.setExtractColumnNameAsColumn(false);
e.setPossibleValueOutputFormat(PossibleValueOutputFormat.Columns);
e.setPropertyHandlerOutputFormat(PropertyHandlerOutputFormat.ToString);
return e.extract(spec);
} else {
String[] names = new String[] { "No outgoing table spec" };
DataType[] types = new DataType[] { StringCell.TYPE };
DataContainer result = new DataContainer(new DataTableSpec(names, types));
result.close();
return result.getTable();
}
}
Aggregations