KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > webapp > taglib > core > grid > util > FilterConditions


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.blandware.atleap.webapp.taglib.core.grid.util;
17
18 /**
19  * <p>Contains filter-specific constants</p>
20  * There are several group of filter conditions presented in this class<br />
21  * <b>Conditions applicable to all filter types</b>:
22  * <ul type="disc">
23  * <li><em>OBJECT_IS_NULL</em> - indicates that field associated with this filter must be a NULL</li>
24  * <li><em>OBJECT_IS_NOT_NULL</em> - indicates that field associated with this filter must not be a NULL</li>
25  * </ul>
26  * <br />
27  * <b>Conditions applicable to date filter</b>:
28  * <ul type="disc">
29  * <li><em>DATE_BEFORE</em> - indicates that value of field associated with this filter must be before specified date</li>
30  * <li><em>DATE_EQUAL</em> - indicates that value of field associated with this filter must be equal to the specified date</li>
31  * <li><em>DATE_NOT_EQUAL</em> - indicates that value of field associated with this filter must not be equal to the specified date</li>
32  * <li><em>DATE_AFTER</em> - indicates that value of field associated with this filter must be after specified date</li>
33  * </ul>
34  * <br />
35  * <b>Conditions applicable to number filter</b>:
36  * <ul type="disc">
37  * <li><em>NUMBER_LESS_THAN</em> - indicates that value of field associated with this filter must be less than specified number</li>
38  * <li><em>NUMBER_LESS_OR_EQUAL</em> - indicates that value of field associated with this filter must be less than or equal to the specified number</li>
39  * <li><em>NUMBER_EQUAL</em> - indicates that value of field associated with this filter must be equal to the specified number</li>
40  * <li><em>NUMBER_NOT_EQUAL</em> - indicates that value of field associated with this filter must not be equal to the specified date</li>
41  * <li><em>NUMBER_GREATER_OR_EQUAL</em> - indicates that value of field associated with this filter must be greater than or equal to the specified number</li>
42  * <li><em>NUMBER_GREATER_THAN</em> - indicates that value of field associated with this filter must be greater than specified number</li>
43  * </ul>
44  * <br />
45  * <b>Conditions applicable to set filter</b>:
46  * <ul type="disc">
47  * <li><em>FIELD_IN_SET</em> - indicates that value of field associated with this filter must be contained in the specified set</li>
48  * <li><em>FIELD_NOT_IN_SET</em> - indicates that value of field associated with this filter must not be contained in the specified set</li>
49  * </ul>
50  * <br />
51  * <b>Conditions applicable to string filter</b>
52  * <ul type="disc">
53  * <li><em>STRING_STARTS_WITH</em> - indicates that value of field associated with this filter must start from the specified string</li>
54  * <li><em>STRING_CONTAINS</em> - indicates that value of field associated with this filter must contain the specified string</li>
55  * <li><em>STRING_EQUAL</em> - indicates that value of field associated with this filter must be lexicographically equal to the specified string</li>
56  * <li><em>STRING_NOT_EQUAL</em> - indicates that value of field associated with this filter must not be lexicographically equal to specified string</li>
57  * <li><em>STRING_ENDS_WITH</em> - indicates that value of field associated with this filter must end with specified string</li>
58  * </ul>
59  * <p><a HREF="FilterConditions.java.htm"><i>View Source</i></a></p>
60  * <p/>
61  *
62  * @author Sergey Zubtcovskii <a HREF="mailto:sergey.zubtcovskii@blandware.com">&lt;sergey.zubtcovskii@blandware.com&gt;</a>
63  * @version $Revision: 1.3 $ $Date: 2005/02/24 19:50:41 $
64  */

65 public class FilterConditions {
66
67     // Common contants
68

69     /**
70      * Indicates that condition was not specified
71      */

72     public static final String JavaDoc CONDITION_NOT_SET = "-";
73
74
75     public static final String JavaDoc LOGIC_COPULA_AND = "and";
76     public static final String JavaDoc LOGIC_COPULA_OR = "or";
77     public static final String JavaDoc OBJECT_IS_NULL = "is null";
78     public static final String JavaDoc OBJECT_IS_NOT_NULL = "is not null";
79
80     // Date filter contants
81
public static final String JavaDoc DATE_BEFORE = "<";
82     public static final String JavaDoc DATE_EQUAL = "=";
83     public static final String JavaDoc DATE_NOT_EQUAL = "<>";
84     public static final String JavaDoc DATE_AFTER = ">";
85
86     // Number filter constants
87
public static final String JavaDoc NUMBER_LESS_THAN = "<";
88     public static final String JavaDoc NUMBER_LESS_OR_EQUAL = "<=";
89     public static final String JavaDoc NUMBER_EQUAL = "=";
90     public static final String JavaDoc NUMBER_NOT_EQUAL = "<>";
91     public static final String JavaDoc NUMBER_GREATER_OR_EQUAL = ">=";
92     public static final String JavaDoc NUMBER_GREATER_THAN = ">";
93
94     // Set filter constants
95
public static final String JavaDoc FIELD_IN_SET = "in";
96     public static final String JavaDoc FIELD_NOT_IN_SET = "not in";
97
98     // String filter constants
99
public static final String JavaDoc STRING_STARTS_WITH = "like '{0}%'";
100     public static final String JavaDoc STRING_CONTAINS = "like '%{0}%'";
101     public static final String JavaDoc STRING_EQUAL = "= '{0}'";
102     public static final String JavaDoc STRING_NOT_EQUAL = "<> '{0}'";
103     public static final String JavaDoc STRING_ENDS_WITH = "like '%{0}'";
104
105 }
106
Popular Tags