Source Code Cross Referenced for Filter.java in  » Library » Apache-beehive-1.0.2-src » org » apache » beehive » netui » databinding » datagrid » api » filter » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache beehive 1.0.2 src » org.apache.beehive.netui.databinding.datagrid.api.filter 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         *
017:         * $Header:$
018:         */
019:        package org.apache.beehive.netui.databinding.datagrid.api.filter;
020:
021:        import org.apache.beehive.netui.util.logging.Logger;
022:
023:        /**
024:         * <p>
025:         * The Filter class is a JavaBean that abstractly represents the data needed to calculate a filter
026:         * for a data set.  A filter consists of some {@link String} expression, a {@link FilterOperation}
027:         * and a filter value.  The mechanism for applying a filter to a data set is not provided here.
028:         * </p>
029:         * <p>
030:         * The filter expression is used to abstractly name some part of a data set to filter.  The filter operation
031:         * is used to describe the operation to use when performing filtering.  The set of operations for
032:         * available for use should be related to a subclass of the Filter type; there are no implicitly
033:         * defined operations.  The filter value is used to describe how to filter a given filter expression.
034:         * For example, in an application performing filtering using SQL, a filter expression <code>pet</code>
035:         * with a filter operation mapping to "equals" and a filter value of "dog" could be transformed
036:         * into a SQL WHERE fragment as:
037:         * <pre>
038:         *   WHERE pet = 'dog'
039:         * </pre>
040:         * The Filter class simply provides an abstraction for a filter's metadata; the mechanism for performing
041:         * this transformation from Filter instance to SQL fragment is not provided here.
042:         * </p>
043:         * <p>
044:         * In addition to the fundamental data fora Filter, two additional properties can be defined.  The
045:         * {@link org.apache.beehive.netui.databinding.datagrid.api.filter.FilterOperationHint} property can
046:         * be used to reference a class of operation related to the hint.  The
047:         * {@link org.apache.beehive.netui.databinding.datagrid.api.filter.FilterTypeHint} property
048:         * defines a hint for the type of data associated with the Filter's filter expression.  This data can be
049:         * used to handle quoting and type conversion for a given filter value.  In the example above, a type hint of
050:         * a {@link org.apache.beehive.netui.databinding.datagrid.api.filter.FilterTypeHint#STRING} can be used
051:         * when constructing the SQL fragment in order to perform the correct quoting of the filter value.
052:         */
053:        public class Filter implements  java.io.Serializable {
054:
055:            private static final Logger LOGGER = Logger
056:                    .getInstance(Filter.class);
057:
058:            private String _filterExpression;
059:            private FilterOperation _filterOperation;
060:            private FilterOperationHint _filterOperationHint;
061:            private Object _value;
062:
063:            private FilterTypeHint _typeHint = FilterTypeHint.getDefault();
064:
065:            /**
066:             * Get the type hint for this filter.
067:             * @return the filter type hint
068:             */
069:            public FilterTypeHint getTypeHint() {
070:                return _typeHint;
071:            }
072:
073:            /**
074:             * Set the type hint for this filter
075:             * @param typeHint the filter type hint
076:             */
077:            public void setTypeHint(FilterTypeHint typeHint) {
078:                _typeHint = typeHint;
079:            }
080:
081:            /**
082:             * Set the filter expression for this filter
083:             * @param filterExpression the filter expression
084:             */
085:            public void setFilterExpression(String filterExpression) {
086:                _filterExpression = filterExpression;
087:            }
088:
089:            /**
090:             * Get the filter expression for this filter
091:             * @return the filter expression
092:             */
093:            public String getFilterExpression() {
094:                return _filterExpression;
095:            }
096:
097:            /**
098:             * Set the filter operation for this filter
099:             * @param filterOperation the filter operation
100:             */
101:            public void setOperation(FilterOperation filterOperation) {
102:                _filterOperation = filterOperation;
103:            }
104:
105:            /**
106:             * Get the filter operation for this filter
107:             * @return the filter operation
108:             */
109:            public FilterOperation getOperation() {
110:                return _filterOperation;
111:            }
112:
113:            /**
114:             * Get the operation hint for this filter
115:             * @return the filter operation hint
116:             */
117:            public FilterOperationHint getOperationHint() {
118:                return _filterOperationHint;
119:            }
120:
121:            /**
122:             * Set the operation hint for this filter
123:             * @param filterOperationHint the filter operation hint
124:             */
125:            public void setOperationHint(FilterOperationHint filterOperationHint) {
126:                _filterOperationHint = filterOperationHint;
127:            }
128:
129:            /**
130:             * Set the value for this filter.  Note, in the default implementation, the <code>value</code>
131:             * must implement {@link java.io.Serializable}.
132:             * @param value the value
133:             */
134:            public void setValue(Object value) {
135:
136:                if (LOGGER.isInfoEnabled()
137:                        && !(value instanceof  java.io.Serializable))
138:                    LOGGER
139:                            .info("Warning: setting a filter value tiat is not serializable.  The Filter object is serializable and should contain only serializable state");
140:
141:                _value = value;
142:            }
143:
144:            /**
145:             * Get the value for this filter.
146:             * @return the value
147:             */
148:            public Object getValue() {
149:                return _value;
150:            }
151:        }
w___w__w__.__j___ava_2_s___.__c_o_m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.