Source Code Cross Referenced for ActionConfig.java in  » J2EE » webwork-2.2.6 » com » opensymphony » xwork » config » entities » 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 » J2EE » webwork 2.2.6 » com.opensymphony.xwork.config.entities 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2002-2006 by OpenSymphony
003:         * All rights reserved.
004:         */
005:        package com.opensymphony.xwork.config.entities;
006:
007:        import com.opensymphony.xwork.util.location.Located;
008:        import java.io.Serializable;
009:        import java.util.*;
010:
011:        /**
012:         * Contains everything needed to configure and execute an action:
013:         * <ul>
014:         * <li>methodName - the method name to execute on the action. If this is null, the Action will be cast to the Action
015:         * Interface and the execute() method called</li>
016:         * <li>clazz - the class name for the action</li>
017:         * <li>params - the params to be set for this action just before execution</li>
018:         * <li>results - the result map {String -> View class}</li>
019:         * <li>resultParameters - params for results {String -> Map}</li>
020:         * <li>typeConverter - the Ognl TypeConverter to use when getting/setting properties</li>
021:         * </ul>
022:         *
023:         * @author Mike
024:         * @author Rainer Hermanns
025:         * @version $Revision: 1531 $
026:         */
027:        public class ActionConfig extends Located implements 
028:                InterceptorListHolder, Parameterizable, Serializable {
029:
030:            private static final long serialVersionUID = -6785758611462211920L;
031:
032:            protected List externalRefs;
033:            protected List interceptors; // a list of interceptorMapping Objects eg. List<InterceptorMapping>
034:            protected Map params;
035:            protected Map results;
036:            protected List exceptionMappings;
037:            protected String className;
038:            protected String methodName;
039:            protected String packageName;
040:
041:            public ActionConfig() {
042:                params = new LinkedHashMap();
043:                results = new LinkedHashMap();
044:                interceptors = new ArrayList();
045:                externalRefs = new ArrayList();
046:                exceptionMappings = new ArrayList();
047:            }
048:
049:            //Helper constuctor to maintain backward compatibility with objects that create ActionConfigs
050:            //TODO this should be removed if these changes are rolled in to xwork CVS
051:            public ActionConfig(String methodName, Class clazz, Map parameters,
052:                    Map results, List interceptors) {
053:                this (methodName, clazz.getName(), parameters, results,
054:                        interceptors);
055:            }
056:
057:            public ActionConfig(String methodName, Class clazz, Map parameters,
058:                    Map results, List interceptors, List exceptionMappings) {
059:                this (methodName, clazz.getName(), parameters, results,
060:                        interceptors, exceptionMappings);
061:            }
062:
063:            public ActionConfig(String methodName, String className,
064:                    Map parameters, Map results, List interceptors) {
065:                this (methodName, className, parameters, results, interceptors,
066:                        Collections.EMPTY_LIST, new String());
067:            }
068:
069:            public ActionConfig(String methodName, String className,
070:                    Map parameters, Map results, List interceptors,
071:                    List exceptionMappings) {
072:                this (methodName, className, parameters, results, interceptors,
073:                        Collections.EMPTY_LIST, exceptionMappings, new String());
074:            }
075:
076:            //TODO If this is commited to CVS we should put the package arg at the front of the ctor and fix
077:            //code that uses it
078:            public ActionConfig(String methodName, String className,
079:                    Map parameters, Map results, List interceptors,
080:                    List externalRefs, String packageName) {
081:                this (methodName, className, parameters, results, interceptors,
082:                        externalRefs, Collections.EMPTY_LIST, packageName);
083:            }
084:
085:            public ActionConfig(String methodName, String className,
086:                    Map parameters, Map results, List interceptors,
087:                    List externalRefs, List exceptionMappings,
088:                    String packageName) {
089:                this .methodName = methodName;
090:                this .interceptors = interceptors;
091:                this .params = parameters;
092:                this .results = results;
093:                this .className = className;
094:                this .externalRefs = externalRefs;
095:                this .exceptionMappings = exceptionMappings;
096:                this .packageName = packageName;
097:            }
098:
099:            public void setClassName(String className) {
100:                this .className = className;
101:            }
102:
103:            public String getClassName() {
104:                return className;
105:            }
106:
107:            public List getExternalRefs() {
108:                return externalRefs;
109:            }
110:
111:            public List getExceptionMappings() {
112:                return exceptionMappings;
113:            }
114:
115:            public List getInterceptors() {
116:                if (interceptors == null) {
117:                    interceptors = new ArrayList();
118:                }
119:
120:                return interceptors;
121:            }
122:
123:            public void setMethodName(String methodName) {
124:                this .methodName = methodName;
125:            }
126:
127:            /**
128:             * Returns name of the action method
129:             *
130:             * @return name of the method to execute
131:             */
132:            public String getMethodName() {
133:                return methodName;
134:            }
135:
136:            /**
137:             * @param packageName The packageName to set.
138:             */
139:            public void setPackageName(String packageName) {
140:                this .packageName = packageName;
141:            }
142:
143:            /**
144:             * @return Returns the packageName.
145:             */
146:            public String getPackageName() {
147:                return packageName;
148:            }
149:
150:            public void setParams(Map params) {
151:                this .params = params;
152:            }
153:
154:            public Map getParams() {
155:                if (params == null) {
156:                    params = new LinkedHashMap();
157:                }
158:
159:                return params;
160:            }
161:
162:            public void setResults(Map results) {
163:                this .results = results;
164:            }
165:
166:            public Map getResults() {
167:                if (results == null) {
168:                    results = new LinkedHashMap();
169:                }
170:
171:                return results;
172:            }
173:
174:            public void addExternalRef(ExternalReference reference) {
175:                getExternalRefs().add(reference);
176:            }
177:
178:            public void addExternalRefs(List externalRefs) {
179:                getExternalRefs().addAll(externalRefs);
180:            }
181:
182:            public void addExceptionMapping(
183:                    ExceptionMappingConfig exceptionMapping) {
184:                getExceptionMappings().add(exceptionMapping);
185:            }
186:
187:            public void addExceptionMappings(List exceptionMappings) {
188:                getExceptionMappings().addAll(exceptionMappings);
189:            }
190:
191:            public void addInterceptor(InterceptorMapping interceptor) {
192:                getInterceptors().add(interceptor);
193:            }
194:
195:            public void addInterceptors(List interceptors) {
196:                getInterceptors().addAll(interceptors);
197:            }
198:
199:            public void addParam(String name, Object value) {
200:                getParams().put(name, value);
201:            }
202:
203:            public void addResultConfig(ResultConfig resultConfig) {
204:                getResults().put(resultConfig.getName(), resultConfig);
205:            }
206:
207:            public boolean equals(Object o) {
208:                if (this  == o) {
209:                    return true;
210:                }
211:
212:                if (!(o instanceof  ActionConfig)) {
213:                    return false;
214:                }
215:
216:                final ActionConfig actionConfig = (ActionConfig) o;
217:
218:                if ((className != null) ? (!className
219:                        .equals(actionConfig.className))
220:                        : (actionConfig.className != null)) {
221:                    return false;
222:                }
223:
224:                if ((interceptors != null) ? (!interceptors
225:                        .equals(actionConfig.interceptors))
226:                        : (actionConfig.interceptors != null)) {
227:                    return false;
228:                }
229:
230:                if ((methodName != null) ? (!methodName
231:                        .equals(actionConfig.methodName))
232:                        : (actionConfig.methodName != null)) {
233:                    return false;
234:                }
235:
236:                if ((params != null) ? (!params.equals(actionConfig.params))
237:                        : (actionConfig.params != null)) {
238:                    return false;
239:                }
240:
241:                if ((results != null) ? (!results.equals(actionConfig.results))
242:                        : (actionConfig.results != null)) {
243:                    return false;
244:                }
245:
246:                return true;
247:            }
248:
249:            public int hashCode() {
250:                int result;
251:                result = ((interceptors != null) ? interceptors.hashCode() : 0);
252:                result = (29 * result)
253:                        + ((params != null) ? params.hashCode() : 0);
254:                result = (29 * result)
255:                        + ((results != null) ? results.hashCode() : 0);
256:                result = (29 * result)
257:                        + ((methodName != null) ? methodName.hashCode() : 0);
258:
259:                return result;
260:            }
261:
262:            public String toString() {
263:                StringBuffer sb = new StringBuffer();
264:                sb.append("{ActionConfig ");
265:                sb.append(className);
266:                if (methodName != null) {
267:                    sb.append(".").append(methodName).append("()");
268:                }
269:                sb.append(" - ").append(location);
270:                sb.append("}");
271:                return sb.toString();
272:            }
273:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.