01: package org.directwebremoting.webwork;
02:
03: /**
04: * Default implementation of <code>AjaxTextResult</code>
05: *
06: * @author <a href='mailto:the_mindstorm[at]evolva[dot]ro'>Alexandru Popescu</a>
07: */
08: public class DefaultAjaxTextResult implements AjaxTextResult {
09: private String text;
10:
11: /**
12: * Empty constructor.
13: *
14: * @see #setText
15: */
16: public DefaultAjaxTextResult() {
17: }
18:
19: /**
20: * Creates an <code>DefaultAjaxTextResult</code> wrapping the given string.
21: *
22: * @param text the string to be wrapped
23: */
24: public DefaultAjaxTextResult(String text) {
25: this .text = text;
26: }
27:
28: /**
29: * @see org.directwebremoting.webwork.AjaxTextResult#getText()
30: */
31: public String getText() {
32: return this .text;
33: }
34:
35: /**
36: * Sets the wrapped string.
37: *
38: * @param text the string to be wrapped in this result
39: */
40: public void setText(String text) {
41: this .text = text;
42: }
43:
44: /**
45: * @see java.lang.Object#toString()
46: */
47: @Override
48: public String toString() {
49: return "[AjaxTextResult: '" + this .text + "']";
50: }
51:
52: }
|