Source Code Cross Referenced for CreationResultParameterContext.java in  » Workflow-Engines » JFolder » org » jfolder » common » web » template » 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.web.template 
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.web.template;
009:
010:        //base classes
011:        import java.util.ArrayList;
012:
013:        //project specific classes
014:        import org.jfolder.common.UnexpectedSystemException;
015:        import org.jfolder.common.utils.web.ParameterSet;
016:
017:        //other classes
018:
019:        public class CreationResultParameterContext implements 
020:                ConsoleParameterContext {
021:
022:            //
023:            private ConsoleParameterHolder parameterCph = null;
024:            private boolean valid = false;
025:
026:            //
027:            private CreationResultParameterContext() {
028:                //
029:                this .parameterCph = ConsoleParameterHolder.newInstance();
030:
031:            }
032:
033:            //
034:            public final static CreationResultParameterContext newInstance(
035:                    ParameterSet inPs) {
036:
037:                CreationResultParameterContext outValue = null;
038:
039:                outValue = new CreationResultParameterContext();
040:                outValue.initialize(inPs);
041:
042:                return outValue;
043:            }
044:
045:            //
046:            public int hashCode() {
047:
048:                int outValue = 0;
049:
050:                outValue += this .parameterCph.hashCode();
051:
052:                return outValue;
053:            }
054:
055:            public boolean equals(Object inObj) {
056:
057:                boolean outValue = true;
058:
059:                if (inObj instanceof  CreationResultParameterContext) {
060:                    CreationResultParameterContext nextCrpc = ((CreationResultParameterContext) inObj);
061:                    outValue &= (this .parameterCph
062:                            .equals(nextCrpc.parameterCph));
063:                    outValue &= (this .valid == nextCrpc.valid);
064:                } else {
065:                    outValue &= false;
066:                }
067:
068:                return outValue;
069:            }
070:
071:            public String getParameter(Integer inIndex) {
072:                return ((String) this .parameterCph.getInput(inIndex));
073:            }
074:
075:            //
076:            public boolean isValid() {
077:                return this .valid;
078:            }
079:
080:            //
081:            private void initialize(ParameterSet inPs) {
082:
083:                //
084:                this .valid = true;
085:
086:                //
087:                int foundParameters = 0;
088:                if (inPs
089:                        .isParameterString(CreationParameterContext.CONSOLE_CREATION_PARAMETER_COUNT)) {
090:                    //
091:                    try {
092:                        String s = inPs
093:                                .getParameter(CreationParameterContext.CONSOLE_CREATION_PARAMETER_COUNT);
094:                        //
095:                        foundParameters = Integer.parseInt(s);
096:                    } catch (NumberFormatException nfe) {
097:                        foundParameters = 0;
098:                        this .valid &= false;
099:                    }
100:                } else {
101:                    this .valid &= false;
102:                }
103:
104:                //
105:                ArrayList indexes = ConsoleParameterHolder.getIndexes();
106:                for (int i = 0; i < indexes.size(); i++) {
107:                    Integer nextIndex = ((Integer) indexes.get(i));
108:
109:                    if (inPs
110:                            .isParameterString(CreationParameterContext.CONSOLE_CREATION_PARAMETER_TYPE_PREFIX
111:                                    + nextIndex)) {
112:                        //
113:
114:                        String nextValueType = inPs
115:                                .getParameter(CreationParameterContext.CONSOLE_CREATION_PARAMETER_TYPE_PREFIX
116:                                        + nextIndex);
117:
118:                        if (i < foundParameters) {
119:                            //
120:                            //
121:                            String nextValue = null;
122:                            Integer nextType = new Integer(nextValueType);
123:                            if (CreationParameterContext.TYPE_TEXT_BOX
124:                                    .equals(nextType)) {
125:                                //
126:                                String nextValueId = CreationParameterContext
127:                                        .getTextBoxFromTypeTextBox(i);
128:                                //
129:                                nextValue = inPs.getParameter(nextValueId);
130:                            } else if (CreationParameterContext.TYPE_FILE_UPLOAD
131:                                    .equals(nextType)) {
132:                                //
133:                                String nextValueId = CreationParameterContext
134:                                        .getFileUploadFromTypeFileUpload(i);
135:                                //
136:                                nextValue = nextValueId;//inPs.getParameter(nextValueId)
137:                            } else if (CreationParameterContext.TYPE_HIDDEN_BOX
138:                                    .equals(nextType)) {
139:                                //
140:                                String nextValueId = CreationParameterContext
141:                                        .getHiddenBoxFromTypeHiddenBox(i);
142:                                //
143:                                nextValue = inPs.getParameter(nextValueId);
144:                            } else if (CreationParameterContext.TYPE_BUTTON
145:                                    .equals(nextType)) {
146:                                //
147:                                //String nextValueId =
148:                                //CreationParameterContext.getButtonFromTypeButton(i);
149:                                //
150:                                nextValue = "";//inPs.getParameter(nextValueId);
151:                            } else if (CreationParameterContext.TYPE_TEXT_AREA
152:                                    .equals(nextType)) {
153:                                //
154:                                String nextValueId = CreationParameterContext
155:                                        .getTextAreaFromTypeTextArea(i);
156:                                //
157:                                nextValue = inPs.getParameter(nextValueId);
158:                            } else if (CreationParameterContext.TYPE_INCLUSIVE_SELECT
159:                                    .equals(nextType)) {
160:                                //
161:                                String nextValueId = CreationParameterContext
162:                                        .getDropDownBoxFromTypeSelectInclusive(i);
163:                                //
164:                                nextValue = inPs.getParameter(nextValueId);
165:                                //
166:                                if (nextValue.length() > 0) {
167:                                    nextValue = nextValue
168:                                            .substring(ConsoleTemplateContext.BRANCH_SEPARATOR
169:                                                    .length());
170:                                } else {
171:                                    nextValueId = CreationParameterContext
172:                                            .getTextBoxFromTypeSelectInclusive(i);
173:                                    //
174:                                    nextValue = inPs.getParameter(nextValueId);
175:                                }
176:                            } else if (CreationParameterContext.TYPE_EXCLUSIVE_SELECT
177:                                    .equals(nextType)) {
178:                                //
179:                                String nextValueId = CreationParameterContext
180:                                        .getDropDownBoxFromTypeSelectExclusive(i);
181:                                //
182:                                nextValue = inPs.getParameter(nextValueId);
183:                                nextValue = nextValue
184:                                        .substring(ConsoleTemplateContext.BRANCH_SEPARATOR
185:                                                .length());
186:                            } else {
187:                                throw new UnexpectedSystemException(
188:                                        "Unknown Type '" + nextType + "'");
189:                            }
190:                            //
191:                            //
192:                            this .parameterCph.addInput(nextIndex, nextValue);
193:                        } else {
194:                            this .parameterCph.addInput(nextIndex, "");
195:                        }
196:                    } else {
197:                        this .valid &= false;
198:                        this .parameterCph.addInput(nextIndex, "");
199:                    }
200:                }
201:            }
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.