01: package com.opensymphony.webwork.dispatcher.mapper;
02:
03: import com.opensymphony.xwork.Result;
04:
05: import java.util.Map;
06:
07: /**
08: * Simple class that holds the action mapping information used to invoke a
09: * WebWork action. The name and namespace are required, but the params map
10: * is optional, and as such may be null. If a params map is supplied,
11: * it <b>must</b> be a mutable map, such as a HashMap.
12: *
13: * @author Patrick Lightbody
14: */
15: public class ActionMapping {
16:
17: private String name;
18: private String namespace;
19: private String method;
20: private Map params;
21: private Result result;
22:
23: public ActionMapping() {
24: }
25:
26: public ActionMapping(Result result) {
27: this .result = result;
28: }
29:
30: public ActionMapping(String name, String namespace, String method,
31: Map params) {
32: this .name = name;
33: this .namespace = namespace;
34: this .method = method;
35: this .params = params;
36: }
37:
38: public String getName() {
39: return name;
40: }
41:
42: public String getNamespace() {
43: return namespace;
44: }
45:
46: public Map getParams() {
47: return params;
48: }
49:
50: public String getMethod() {
51: if (null != method && "".equals(method)) {
52: return null;
53: } else {
54: return method;
55: }
56: }
57:
58: public Result getResult() {
59: return result;
60: }
61:
62: public void setResult(Result result) {
63: this .result = result;
64: }
65:
66: public void setName(String name) {
67: this .name = name;
68: }
69:
70: public void setNamespace(String namespace) {
71: this .namespace = namespace;
72: }
73:
74: public void setMethod(String method) {
75: this .method = method;
76: }
77:
78: public void setParams(Map params) {
79: this.params = params;
80: }
81: }
|