Source Code Cross Referenced for FormalParameter.java in  » Workflow-Engines » wfmopen-2.1.1 » de » danet » an » workflow » api » 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 » wfmopen 2.1.1 » de.danet.an.workflow.api 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of the WfMOpen project.
003:         * Copyright (C) 2001-2004 Danet GmbH (www.danet.de), GS-AN.
004:         * All rights reserved.
005:         *
006:         * This program is free software; you can redistribute it and/or modify
007:         * it under the terms of the GNU General Public License as published by
008:         * the Free Software Foundation; either version 2 of the License, or
009:         * (at your option) any later version.
010:         *
011:         * This program is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014:         * GNU General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU General Public License
017:         * along with this program; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
019:         *
020:         * $Id: FormalParameter.java,v 1.4 2007/03/27 21:59:44 mlipp Exp $
021:         *
022:         * $Log: FormalParameter.java,v $
023:         * Revision 1.4  2007/03/27 21:59:44  mlipp
024:         * Fixed lots of checkstyle warnings.
025:         *
026:         * Revision 1.3  2006/09/29 12:32:07  drmlipp
027:         * Consistently using WfMOpen as projct name now.
028:         *
029:         * Revision 1.2  2006/03/08 14:46:44  drmlipp
030:         * Synchronized with 1.3.3p5.
031:         *
032:         * Revision 1.1.1.3.6.1  2006/02/15 20:17:08  drmlipp
033:         * Added toString() for diagnostic purposes.
034:         *
035:         * Revision 1.1.1.3  2004/08/18 15:17:36  drmlipp
036:         * Update to 1.2
037:         *
038:         * Revision 1.4  2004/01/19 12:30:58  lipp
039:         * SchemaType now supported properly.
040:         *
041:         * Revision 1.3  2003/06/27 08:51:46  lipp
042:         * Fixed copyright/license information.
043:         *
044:         * Revision 1.2  2003/05/15 07:46:41  lipp
045:         * Proper handling of JavaScript default double result.
046:         *
047:         * Revision 1.1  2003/05/06 13:21:29  lipp
048:         * Resolved cyclic dependency.
049:         *
050:         * Revision 1.1  2002/12/19 21:37:42  lipp
051:         * Reorganized interfaces.
052:         *
053:         * Revision 1.1  2002/10/06 20:14:38  lipp
054:         * Updated argument handling.
055:         *
056:         * Revision 1.6  2002/09/27 11:28:25  huaiyang
057:         * Make constructor of Mode private and use fromString instead.
058:         *
059:         * Revision 1.5  2002/09/27 10:47:57  lipp
060:         * Added equals and hashcode.
061:         *
062:         * Revision 1.4  2002/09/26 09:53:00  huaiyang
063:         * In readresolve method use text representation to compare.
064:         *
065:         * Revision 1.3  2002/09/23 20:31:28  lipp
066:         * Implemented async/sync invocation.
067:         *
068:         * Revision 1.2  2002/09/23 15:12:39  lipp
069:         * Extended tool implementation definition and usage.
070:         *
071:         * Revision 1.1  2002/09/23 09:32:34  huaiyang
072:         * initial.
073:         *
074:         *
075:         */
076:        package de.danet.an.workflow.api;
077:
078:        import java.io.Serializable;
079:
080:        /**
081:         * This class provides a description of a formal parameter as used
082:         * for workflow processes and workflow applications.
083:         */
084:        public class FormalParameter implements  Serializable {
085:
086:            /** Identifier for the parameter. */
087:            private String id;
088:            /** Index for the parameter. */
089:            private String index;
090:            /** Defined how this formal parameter defined. */
091:            private Mode mode;
092:            /** Parameter type. */
093:            private Object type;
094:
095:            /**
096:             * Defines a class for representing priorities in a type save way.
097:             */
098:            public static final class Mode implements  Serializable {
099:                private static final long serialVersionUID = -3349015565438817722L;
100:                /** Mode as Input Parameter. */
101:                public static final Mode IN = new Mode("IN");
102:                /** Mode as Output Parameter. */
103:                public static final Mode OUT = new Mode("OUT");
104:                /** Mode as input and output parameter. */
105:                public static final Mode INOUT = new Mode("INOUT");
106:
107:                private String mode = null;
108:
109:                /**
110:                 * Default constructor.
111:                 * @param newMode mode as String. 
112:                 */
113:                private Mode(String newMode) {
114:                    mode = newMode;
115:                }
116:
117:                /**
118:                 * Get a Mode by name.
119:                 * @param text mode name to search
120:                 * @return mode object
121:                 * @throws IllegalArgumentException if <code>text</code> is not a valid
122:                 * mode name.
123:                 */
124:                public static Mode fromString(String text)
125:                        throws IllegalArgumentException {
126:                    if (text == null) {
127:                        throw new IllegalArgumentException(text);
128:                    }
129:                    if (text.equals(IN.toString())) {
130:                        return IN;
131:                    } else if (text.equals(OUT.toString())) {
132:                        return OUT;
133:                    } else if (text.equals(INOUT.toString())) {
134:                        return INOUT;
135:                    } else {
136:                        throw new IllegalArgumentException(text);
137:                    }
138:                }
139:
140:                /**
141:                 * Returns the mode as text.
142:                 * @return mode as text
143:                 */
144:                public final String toString() {
145:                    return mode;
146:                }
147:
148:                /**
149:                 * Perform instance substitution during serialization.
150:                 */
151:                private Object readResolve() throws IllegalArgumentException {
152:                    try {
153:                        return fromString(mode);
154:                    } catch (IllegalArgumentException iae) {
155:                        throw new IllegalArgumentException(
156:                                "Unexpected error in serialization");
157:                    }
158:                }
159:            }
160:
161:            /**
162:             * Creates a new <code>FormalParameter</code>.
163:             * @param newId identifier of the formal parameter in String
164:             * @param newIndex index of the formal parameter in String. In the
165:             * 1.iteration if the new Index is not null, a warning will be 
166:             * generated.
167:             * @param newMode mode of this formal parameter 
168:             * @param newType type of this formal parameter 
169:             */
170:            public FormalParameter(String newId, String newIndex, Mode newMode,
171:                    Object newType) {
172:                id = newId;
173:                index = newIndex;
174:                mode = newMode;
175:                type = newType;
176:            }
177:
178:            /**
179:             * Return the id of the formal parameter.
180:             * @return a String representing the id value
181:             */
182:            public String id() {
183:                return id;
184:            }
185:
186:            /**
187:             * Return the index of the formal parameter.
188:             * @return a String representing the index value
189:             */
190:            public String index() {
191:                return index;
192:            }
193:
194:            /**
195:             * Return the mode of the formal parameter.
196:             * @return the <code>FormalParameter.Mode</code> of the formal parameter.
197:             */
198:            public Mode mode() {
199:                return mode;
200:            }
201:
202:            /**
203:             * Return the type of the formal parameter. Types are represented
204:             * as defined for {@link de.danet.an.workflow.api.ProcessMgr
205:             * <code>ProcessMgr.contextSignature</code>}.
206:             * @return the type of the formal parameter.
207:             */
208:            public Object type() {
209:                return type;
210:            }
211:
212:            /**
213:             * Compare two formal parameter objects.
214:             * @param obj the object to compare with.
215:             * @return <code>true</code> if the objects are equal.
216:             */
217:            public boolean equals(Object obj) {
218:                FormalParameter o = (FormalParameter) obj;
219:                return (id.equals(o.id) && index.equals(o.index) && mode
220:                        .equals(o.mode));
221:            }
222:
223:            /**
224:             * Evaluate hash code.
225:             * @return the hash code.
226:             */
227:            public int hashCode() {
228:                return (id.hashCode() ^ index.hashCode());
229:            }
230:
231:            /**
232:             * Create string representation for debugging purposes.
233:             * @return the result.
234:             */
235:            public String toString() {
236:                return "FormalParameter[id=" + id + ";index=" + index
237:                        + ";mode=" + mode + ";type=" + type + "]";
238:            }
239:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.