Source Code Cross Referenced for DynamicConceptTagValidatorPart.java in  » Workflow-Engines » JFolder » org » jfolder » common » tagging » 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 » Workflow Engines » JFolder » org.jfolder.common.tagging 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JFolder, Copyright 2001-2006 Gary Steinmetz
003:         *
004:         * Distributable under LGPL license.
005:         * See terms of license at gnu.org.
006:         */
007:
008:        package org.jfolder.common.tagging;
009:
010:        //base classes
011:        import java.util.ArrayList;
012:        import java.util.HashSet;
013:
014:        //project specific classes
015:        import org.jfolder.common.StandardDataTypes;
016:        import org.jfolder.common.UnexpectedSystemException;
017:        import org.jfolder.common.utils.misc.MiscHelper;
018:
019:        //other classes
020:
021:        public class DynamicConceptTagValidatorPart {
022:
023:            //
024:            private final static int COMMAND_NULL = -1;
025:            //
026:            protected final static int COMMAND_FLAG_PRESENT = 1;
027:            protected final static int COMMAND_FLAG_NOT_PRESENT = 2;
028:            protected final static int COMMAND_FLAG_EQUAL = 3;
029:            protected final static int COMMAND_FLAG_NOT_EQUAL = 4;
030:            protected final static int COMMAND_FLAG_LESS_THAN = 5;
031:            protected final static int COMMAND_FLAG_GREATER_THAN = 6;
032:            protected final static int COMMAND_FLAG_GREATER_THAN_OR_EQUAL = 7;
033:            protected final static int COMMAND_FLAG_LESS_THAN_OR_EQUAL = 8;
034:            protected final static int COMMAND_CONTAINS_PARENT_NODE = 9;
035:            protected final static int COMMAND_DOES_NOT_CONTAIN_PARENT_NODE = 10;
036:            protected final static int COMMAND_DOES_RETURN = 11;
037:            protected final static int COMMAND_DOES_NOT_RETURN = 12;
038:            protected final static int COMMAND_SUB_VALIDATE = 13;
039:            //
040:            protected final static int COMMAND_IS_CLASS = 14;
041:
042:            //
043:            private int commandType = 0;
044:            //
045:            private String ctNs = null;
046:            private String ctName = null;
047:            //
048:            private String flagNs = null;
049:            private String flagName = null;
050:            private Object flagValue = null;
051:            //
052:            private String errorMessage = null;
053:            //
054:            private HashSet setForClasses = null;
055:            //
056:            private DynamicConceptTagValidator subDctv = null;
057:            //
058:            private Integer cachedHashCode = null;
059:
060:            private DynamicConceptTagValidatorPart(int inCommandType) {
061:                reset();
062:                this .commandType = inCommandType;
063:            }
064:
065:            public int hashCode() {
066:
067:                int outValue = 0;
068:
069:                if (this .cachedHashCode != null) {
070:                    outValue = this .cachedHashCode.intValue();
071:                } else {
072:                    outValue += this .commandType;
073:                    outValue += MiscHelper.hashCodeOrZero(this .ctNs);
074:                    outValue += MiscHelper.hashCodeOrZero(this .ctName);
075:                    outValue += MiscHelper.hashCodeOrZero(this .flagNs);
076:                    outValue += MiscHelper.hashCodeOrZero(this .flagName);
077:                    outValue += MiscHelper.hashCodeOrZero(this .flagValue);
078:                    outValue += MiscHelper.hashCodeOrZero(this .errorMessage);
079:                    outValue += this .setForClasses.hashCode();
080:                    outValue += MiscHelper.hashCodeOrZero(this .subDctv);
081:                    //
082:                    this .cachedHashCode = new Integer(outValue);
083:                }
084:
085:                return outValue;
086:            }
087:
088:            public boolean equals(Object inObj) {
089:
090:                boolean outValue = true;
091:
092:                if (inObj instanceof  DynamicConceptTagValidatorPart) {
093:                    DynamicConceptTagValidatorPart nextDctvp = ((DynamicConceptTagValidatorPart) inObj);
094:                    //
095:                    outValue &= (this .commandType == nextDctvp.commandType);
096:                    outValue &= MiscHelper.equalsOrNull(this .ctNs,
097:                            nextDctvp.ctNs);
098:                    outValue &= MiscHelper.equalsOrNull(this .ctName,
099:                            nextDctvp.ctName);
100:                    outValue &= MiscHelper.equalsOrNull(this .flagNs,
101:                            nextDctvp.flagNs);
102:                    outValue &= MiscHelper.equalsOrNull(this .flagName,
103:                            nextDctvp.flagName);
104:                    outValue &= MiscHelper.equalsOrNull(this .flagValue,
105:                            nextDctvp.flagValue);
106:                    outValue &= MiscHelper.equalsOrNull(this .errorMessage,
107:                            nextDctvp.errorMessage);
108:                    outValue &= this .setForClasses
109:                            .equals(nextDctvp.setForClasses);
110:                    outValue &= MiscHelper.equalsOrNull(this .subDctv,
111:                            nextDctvp.subDctv);
112:                } else {
113:                    outValue &= false;
114:                }
115:
116:                return outValue;
117:            }
118:
119:            //
120:            public final static DynamicConceptTagValidatorPart newCommandIsClass(
121:                    Class inClass[], String inError) {
122:
123:                DynamicConceptTagValidatorPart outValue = null;
124:
125:                outValue = new DynamicConceptTagValidatorPart(COMMAND_IS_CLASS);
126:                for (int i = 0; i < inClass.length; i++) {
127:                    outValue.setForClasses.add(inClass[i]);
128:                }
129:                outValue.errorMessage = inError;
130:
131:                return outValue;
132:            }
133:
134:            public final static DynamicConceptTagValidatorPart newCommandDoesReturn(
135:                    Class inClass[], String inError) {
136:
137:                DynamicConceptTagValidatorPart outValue = null;
138:
139:                outValue = new DynamicConceptTagValidatorPart(
140:                        COMMAND_DOES_RETURN);
141:                for (int i = 0; i < inClass.length; i++) {
142:                    outValue.setForClasses.add(inClass[i]);
143:                }
144:                outValue.errorMessage = inError;
145:
146:                return outValue;
147:            }
148:
149:            public final static DynamicConceptTagValidatorPart newCommandDoesNotReturn(
150:                    Class inClass[], String inError) {
151:
152:                DynamicConceptTagValidatorPart outValue = null;
153:
154:                outValue = new DynamicConceptTagValidatorPart(
155:                        COMMAND_DOES_NOT_RETURN);
156:                for (int i = 0; i < inClass.length; i++) {
157:                    outValue.setForClasses.add(inClass[i]);
158:                }
159:                outValue.errorMessage = inError;
160:
161:                return outValue;
162:            }
163:
164:            public final static DynamicConceptTagValidatorPart newCommandFlagPresent(
165:                    String inNs, String inName, String inError) {
166:
167:                DynamicConceptTagValidatorPart outValue = null;
168:
169:                outValue = new DynamicConceptTagValidatorPart(
170:                        COMMAND_FLAG_PRESENT);
171:                outValue.flagNs = inNs;
172:                outValue.flagName = inName;
173:                outValue.errorMessage = inError;
174:
175:                return outValue;
176:            }
177:
178:            public final static DynamicConceptTagValidatorPart newCommandFlagNotPresent(
179:                    String inNs, String inName, String inError) {
180:
181:                DynamicConceptTagValidatorPart outValue = null;
182:
183:                outValue = new DynamicConceptTagValidatorPart(
184:                        COMMAND_FLAG_NOT_PRESENT);
185:                outValue.flagNs = inNs;
186:                outValue.flagName = inName;
187:                outValue.errorMessage = inError;
188:
189:                return outValue;
190:            }
191:
192:            public final static DynamicConceptTagValidatorPart newCommandFlagEqual(
193:                    String inNs, String inName, Object inValue, String inError) {
194:
195:                DynamicConceptTagValidatorPart outValue = null;
196:
197:                outValue = new DynamicConceptTagValidatorPart(
198:                        COMMAND_FLAG_EQUAL);
199:                outValue.flagNs = inNs;
200:                outValue.flagName = inName;
201:                outValue.flagValue = inValue;
202:                outValue.errorMessage = inError;
203:
204:                return outValue;
205:            }
206:
207:            public void reset() {
208:                this .commandType = COMMAND_NULL;
209:                this .setForClasses = new HashSet();
210:            }
211:
212:            //
213:            public int getCommandType() {
214:                return this .commandType;
215:            }
216:
217:            //
218:            public String getErrorMessage() {
219:                return this .errorMessage;
220:            }
221:
222:            //
223:            public boolean isCommandFlagPresent() {
224:                return (this .commandType == COMMAND_FLAG_PRESENT);
225:            }
226:
227:            public boolean isCommandFlagNotPresent() {
228:                return (this .commandType == COMMAND_FLAG_NOT_PRESENT);
229:            }
230:
231:            public boolean isCommandFlagEqual() {
232:                return (this .commandType == COMMAND_FLAG_EQUAL);
233:            }
234:
235:            public boolean isCommandFlagNotEqual() {
236:                return (this .commandType == COMMAND_FLAG_NOT_EQUAL);
237:            }
238:
239:            public boolean isCommandFlagLessThan() {
240:                return (this .commandType == COMMAND_FLAG_LESS_THAN);
241:            }
242:
243:            public boolean isCommandFlagGreaterThan() {
244:                return (this .commandType == COMMAND_FLAG_GREATER_THAN);
245:            }
246:
247:            public boolean isCommandFlagGreaterThanOrEqual() {
248:                return (this .commandType == COMMAND_FLAG_GREATER_THAN_OR_EQUAL);
249:            }
250:
251:            public boolean isCommandFlagLessThanOrEqual() {
252:                return (this .commandType == COMMAND_FLAG_LESS_THAN_OR_EQUAL);
253:            }
254:
255:            public boolean isCommandContainsParentNode() {
256:                return (this .commandType == COMMAND_CONTAINS_PARENT_NODE);
257:            }
258:
259:            public boolean isCommandDoesNotContainParentNode() {
260:                return (this .commandType == COMMAND_DOES_NOT_CONTAIN_PARENT_NODE);
261:            }
262:
263:            public boolean isCommandDoesReturn() {
264:                return (this .commandType == COMMAND_DOES_RETURN);
265:            }
266:
267:            public boolean isCommandDoesNotReturn() {
268:                return (this .commandType == COMMAND_DOES_NOT_RETURN);
269:            }
270:
271:            public boolean isCommandSubValidate() {
272:                return (this .commandType == COMMAND_SUB_VALIDATE);
273:            }
274:
275:            public boolean isCommandIsClass() {
276:                return (this .commandType == COMMAND_IS_CLASS);
277:            }
278:
279:            //
280:            public String getFlagNamespace() {
281:                return this .flagNs;
282:            }
283:
284:            public String getFlagName() {
285:                return this .flagName;
286:            }
287:
288:            public Object getFlagValue() {
289:                return this .flagValue;
290:            }
291:
292:            //
293:            public Class[] getClasses() {
294:                return ((Class[]) this .setForClasses.toArray(new Class[0]));
295:            }
296:
297:            //
298:            public DynamicConceptTagValidator getSubValidator() {
299:                return this.subDctv;
300:            }
301:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.