Source Code Cross Referenced for MatchNotQuery.java in  » Search-Engine » Jofti » com » jofti » query » 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 » Search Engine » Jofti » com.jofti.query 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.jofti.query;
002:
003:        import com.jofti.api.IndexQuery;
004:        import com.jofti.core.QueryId;
005:        import com.jofti.core.QueryType;
006:        import com.jofti.util.ReflectionUtil;
007:
008:        /**
009:         * 
010:         *
011:         * A utility class to enable simple queries to be done easily. The Query matches everything not equal the 
012:         * value passed in for that particular field. This is equivalent to !=.<p>
013:         * 
014:         * 
015:         *  This query cannot be combined with any other. iF you want to construct more complex queries use the @see com.jofti.query.Query class.
016:         *  <p>
017:         *  @author Steve Woodcock
018:         */
019:        public class MatchNotQuery implements  IndexQuery, QueryId {
020:
021:            Class className;
022:            String propertyName;
023:            Comparable value;
024:
025:            public final Object alias;
026:            final QueryType QUERY_ID = QueryType.NOT_QUERY;
027:
028:            /**
029:             * Construct a query supplying the classname of the object type to be returned,and the 
030:             * field to be queried and the value to be used. <p>
031:             * 
032:             * The field type in the object and the value must be of the same type.
033:             * <p>
034:             * 
035:             * An example usage  would be:
036:             * <p>
037:             * new MatchNotQuery(org.package.Myclass.class, "myProperty" ,"some value");
038:             * <p>
039:             * @param className - the class of object to be returned.
040:             * @param propertyName - the field name to use
041:             * @param value - the value that is used as the search value.
042:             */
043:
044:            public MatchNotQuery(Class className, String propertyName,
045:                    Comparable value) {
046:                this (className, propertyName, value, null);
047:            }
048:
049:            public MatchNotQuery(Class className, String propertyName,
050:                    Comparable value, Object alias) {
051:                this .className = className;
052:                this .propertyName = propertyName;
053:                this .value = value;
054:                this .alias = alias;
055:            }
056:
057:            /**
058:             * Construct a query supplying the classname of the object type to be returned,and the 
059:             * field to be queried and the value to be used. <p>
060:             * 
061:             * The field type in the object and the value must be of the same type.
062:             * <p>
063:             * 
064:             * An example usage  would be:
065:             * <p>
066:             * new MatchNotQuery("org.package.Myclass", "myProperty" ,"some value");
067:             * <p>
068:             * @param className - the class of object to be returned.
069:             * @param propertyName - the field name to use
070:             * @param value - the value that is used as the search value.
071:             */
072:
073:            public MatchNotQuery(String className, String propertyName,
074:                    Comparable value) {
075:                this (className, propertyName, value, null);
076:            }
077:
078:            public MatchNotQuery(String className, String propertyName,
079:                    Comparable value, Object alias) {
080:                Class clazz = null;
081:                try {
082:                    clazz = ReflectionUtil.classForName(className);
083:                } catch (Exception e) {
084:                    throw new RuntimeException(e);
085:                }
086:                this .className = clazz;
087:                this .propertyName = propertyName;
088:                this .value = value;
089:                this .alias = alias;
090:            }
091:
092:            /**
093:             * Construct a query supplying the value to be searched against. 
094:             * This is a convenience method for classes (such as String,Integer etc)
095:             * that have no property value as such. Instead the value is the class type.
096:             * <p>
097:             * 
098:             * An example usage  would be:
099:             * <p>
100:             * new MatchNotQuery("some value");
101:             * <p>
102:             * This is so you do not have to use the methods above in the manner of
103:             * <p>
104:             * new MatchNotQuery("java.lang.String", null ,"some value"); 
105:             * <p>
106:
107:             * @param value - the value that is used as the search value.
108:             */
109:            public MatchNotQuery(Comparable value) {
110:                this .value = value;
111:                this .alias = null;
112:            }
113:
114:            /**
115:             * @return Returns the className.
116:             */
117:            public Class getClassName() {
118:                return className;
119:            }
120:
121:            /**
122:             * @return Returns the propertyName.
123:             */
124:            public String getPropertyName() {
125:                return propertyName;
126:            }
127:
128:            /**
129:             * @return Returns the value.
130:             */
131:            public Comparable getValue() {
132:                return value;
133:            }
134:
135:            public QueryType getQueryType() {
136:
137:                return QUERY_ID;
138:            }
139:
140:            public Object getAlias() {
141:                return alias;
142:            }
143:
144:            public IndexQuery setParameter(String name, Object value) {
145:                throw new UnsupportedOperationException(
146:                        "Parameters are not supported for convenience classes");
147:            }
148:
149:            /* (non-Javadoc)
150:             * @see com.jofti.api.IndexQuery#setParameter(int, java.lang.Object)
151:             */
152:            public IndexQuery setParameter(int position, Object value) {
153:                throw new UnsupportedOperationException(
154:                        "Parameters are not supported for convenience classes");
155:
156:            }
157:
158:            public IndexQuery setFirstResult(int firstResult) {
159:                throw new UnsupportedOperationException(
160:                        "result limits are not supported for convenience classes");
161:
162:            }
163:
164:            public IndexQuery setMaxResults(int maxResults) {
165:                throw new UnsupportedOperationException(
166:                        "result limits are not supported for convenience classes");
167:
168:            }
169:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.