KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jaspersoft > jasperserver > api > metadata > view > domain > FilterCriteria


1 /*
2  * Copyright (C) 2006 JasperSoft http://www.jaspersoft.com
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed WITHOUT ANY WARRANTY; and without the
10  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
15  * or write to:
16  *
17  * Free Software Foundation, Inc.,
18  * 59 Temple Place - Suite 330,
19  * Boston, MA USA 02111-1307
20  */

21
22 package com.jaspersoft.jasperserver.api.metadata.view.domain;
23
24
25
26 /**
27  * @author swood
28  * @version $Id: FilterCriteria.java 3970 2006-07-13 13:28:20Z swood $
29  */

30 public class FilterCriteria extends FilterElementCollection
31 {
32     public static ParentFolderFilter createParentFolderFilter(String JavaDoc folderURI) {
33         ParentFolderFilter filter = new ParentFolderFilter();
34         filter.setFolderURI(folderURI);
35         return filter;
36     }
37
38     public static PropertyFilter createPropertyEqualsFilter(String JavaDoc property, Object JavaDoc value) {
39         return createPropertyFilter(property, value, PropertyFilter.EQ);
40     }
41
42     public static PropertyFilter createPropertyLikeFilter(String JavaDoc propery, Object JavaDoc value) {
43         return createPropertyFilter(propery, value, PropertyFilter.LIKE);
44     }
45
46     protected static PropertyFilter createPropertyFilter(String JavaDoc property, Object JavaDoc value, byte op) {
47         PropertyFilter filter = new PropertyFilter();
48         filter.setOp(op);
49         filter.setProperty(property);
50         filter.setValue(value);
51         return filter;
52     }
53
54     private Class JavaDoc _class;
55
56     public static FilterCriteria createFilter() {
57         return new FilterCriteria();
58     }
59
60     public static FilterCriteria createFilter(Class JavaDoc _class) {
61         return new FilterCriteria(_class);
62     }
63     
64     public FilterCriteria () {
65         this(null);
66     }
67     
68     public FilterCriteria (Class JavaDoc _class) {
69         super();
70         this._class = _class;
71     }
72
73     public Class JavaDoc getFilterClass() {
74         return _class;
75     }
76
77     public void setFilterClass(Class JavaDoc _class) {
78         this._class = _class;
79     }
80 }
81
Popular Tags