本文整理匯總了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);
}
}