1 package org.seasar.cubby.action;
2
3 import java.text.MessageFormat;
4 import java.util.Map;
5
6 import org.seasar.cubby.util.Messages;
7
8
9
10
11
12 public abstract class Action {
13
14
15
16
17 protected ActionErrors errors;
18
19
20
21
22 protected Map<String, Object> flash;
23
24
25
26
27 public void initialize() {
28 }
29
30
31
32
33 public void prerender() {
34 }
35
36
37
38
39 public void postrender() {
40 }
41
42
43
44
45
46 public ActionErrors getErrors() {
47 return errors;
48 }
49
50
51
52
53
54 public void setErrors(ActionErrors errors) {
55 this.errors = errors;
56 }
57
58
59
60
61
62 public Map<String, Object> getFlash() {
63 return flash;
64 }
65
66
67
68
69
70 public void setFlash(Map<String, Object> flash) {
71 this.flash = flash;
72 }
73
74
75
76
77
78
79
80 public String getText(String key) {
81 return Messages.getText(key);
82 }
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97 public String getText(String key, Object... args) {
98 String text = getText(key);
99 MessageFormat format = new MessageFormat(text);
100 return format.format(args);
101 }
102
103 }