本文整理汇总了Java中org.kuali.rice.kns.web.comparator.NullValueComparator类的典型用法代码示例。如果您正苦于以下问题:Java NullValueComparator类的具体用法?Java NullValueComparator怎么用?Java NullValueComparator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NullValueComparator类属于org.kuali.rice.kns.web.comparator包,在下文中一共展示了NullValueComparator类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findBestValueComparatorForColumn
import org.kuali.rice.kns.web.comparator.NullValueComparator; //导入依赖的package包/类
/**
* Given a list of results from a lookup, determines the best comparator to use on the String values of each of these columns
*
* This method exists because each cell (represented by the Column object) lists the comparator that should be used within it based on the property value class,
* so we gotta go thru the whole list and determine the best comparator to use
*
* @param resultsTable
* @param column
* @return
*/
public static Comparator findBestValueComparatorForColumn(List<ResultRow> resultTable, int column) {
// BIG HACK
Comparator comp = NullValueComparator.getInstance();
for (ResultRow row : resultTable) {
Comparator tempComp = row.getColumns().get(column).getValueComparator();
if (tempComp != null && !NullValueComparator.class.equals(tempComp.getClass())) {
return tempComp;
}
}
return comp;
}