本文整理汇总了Java中org.dashbuilder.dataset.DataSetMetadata.getColumnId方法的典型用法代码示例。如果您正苦于以下问题:Java DataSetMetadata.getColumnId方法的具体用法?Java DataSetMetadata.getColumnId怎么用?Java DataSetMetadata.getColumnId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dashbuilder.dataset.DataSetMetadata
的用法示例。
在下文中一共展示了DataSetMetadata.getColumnId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import org.dashbuilder.dataset.DataSetMetadata; //导入方法依赖的package包/类
@Override
public EditDataSetDef load(Path path) {
try {
DataSetDef def = dataSetDefRegistry.loadDataSetDef(path);
if (def == null) {
return null;
}
// Clone the definition
DataSetDef cloned = def.clone();
// Enable all columns and set columns to null, force to obtain metadata with all original columns
// and all original column types.
boolean clonedAllColumns = cloned.isAllColumnsEnabled();
List<DataColumnDef> clonedColumns = cloned.getColumns();
cloned.setAllColumnsEnabled(true);
cloned.setColumns(null);
// Obtain all original columns and all original column types.
DataSetMetadata _cd = dataSetManager.resolveProvider(cloned)
.getDataSetMetadata(cloned);
// Return the list of original columns and its types.
List<DataColumnDef> columns = new ArrayList<DataColumnDef>();
if (_cd.getNumberOfColumns() > 0) {
for (int x = 0; x < _cd.getNumberOfColumns(); x++) {
String cId = _cd.getColumnId(x);
ColumnType cType = _cd.getColumnType(x);
DataColumnDef cdef = new DataColumnDef(cId, cType);
columns.add(cdef);
}
}
// Set columns attributes as initially were.
cloned.setAllColumnsEnabled(clonedAllColumns);
cloned.setColumns(clonedColumns);
return new EditDataSetDef(cloned, columns);
} catch (Exception e) {
throw exceptionManager.handleException(e);
}
}