1
2
3
4
5 package org.rcfaces.core.internal.tools;
6
7 import javax.faces.FacesException;
8 import javax.faces.model.ArrayDataModel;
9 import javax.faces.model.DataModel;
10
11 import org.rcfaces.core.model.IFilterProperties;
12
13
14
15
16
17 public class FilteredDataModel {
18 private static final String REVISION = "$Revision: 1.18 $";
19
20 public static DataModel filter(DataModel dataModel,
21 IFilterProperties filters) {
22 if (filters == null || filters.size() < 1) {
23 return dataModel;
24 }
25
26 if (dataModel instanceof ArrayDataModel) {
27 return dataModel;
28 }
29
30 throw new FacesException("Can not filter dataModel '" + dataModel
31 + "'.");
32 }
33
34 }