@Override public Collection<String> getContainerPropertyIds() { if (properties == null) { if (getDynaClass() != null) { ArrayList<String> props = new ArrayList<String>(); for (DynaProperty db : getDynaClass().getDynaProperties()) { if (db.getType() != null) { props.add(db.getName()); } else { // type may be null in some cases Logger.getLogger(ListContainer.class.getName()) .log(Level.FINE, "Type not detected for property {0}", db.getName()); } } props.remove("class"); properties = props; } else { return Collections.EMPTY_LIST; } } return properties; }
@Override public Collection<?> getSortableContainerPropertyIds() { if (backingList instanceof SortableLazyList) { // Assume SortableLazyList can sort by any Comparable property } else if (backingList instanceof LazyList) { // When using LazyList, don't support sorting by default // as the sorting should most probably be done at backend call level return Collections.emptySet(); } final ArrayList<String> props = new ArrayList<String>(); for (Object a : getContainerPropertyIds()) { DynaProperty db = getDynaClass().getDynaProperty(a.toString()); if (db != null && db.getType() != null && (db.getType().isPrimitive() || Comparable.class.isAssignableFrom(db.getType()))) { props.add(db.getName()); } } return props; }