2009/05/20 - Apache Shale has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shale.dialog.basic.config;
19
20 import org.apache.shale.dialog.basic.model.ViewState;
21
22 /***
23 * <p>{@link ViewStateImpl} is a basic implementation of
24 * {@link ViewState}.</p>
25 *
26 * @since 1.0.4
27 */
28
29 public class ViewStateImpl extends AbstractState implements ViewState {
30
31
32
33
34
35 /***
36 * <p>Flag indicating that the transition to this view should be done
37 * with a redirect.</p>
38 */
39 private boolean redirect = false;
40
41
42 /***
43 * <p>The view identifier of the JavaServer Faces view to render if this
44 * state is entered.</p>
45 */
46 private String viewId = null;
47
48
49
50
51
52 /***
53 * {@inheritDoc}
54 */
55 public boolean isRedirect() {
56
57 return this.redirect;
58
59 }
60
61
62 /***
63 * {@inheritDoc}
64 */
65 public String getViewId() {
66
67 return this.viewId;
68
69 }
70
71
72
73
74
75 /***
76 * <p>Render a printable version of this instance.</p>
77 *
78 * @return The printable version of this instance
79 */
80 public String toString() {
81
82 return "ViewState[dialog=" +
83 ((getDialog() != null) ? getDialog().getName() : "<null>") +
84 ",name=" + getName() +
85 ",redirect=" + this.redirect +
86 ",viewId=" + this.viewId + "]";
87
88 }
89
90
91
92
93
94 /***
95 * <p>Set the redirect flag for this state.</p>
96 *
97 * @param redirect The new redirect flag
98 */
99 public void setRedirect(boolean redirect) {
100
101 this.redirect = redirect;
102
103 }
104
105
106 /***
107 * <p>Set the view identifier of the JavaServer Faces view to render
108 * if this state is entered.</p>
109 *
110 * @param viewId The new view identifier
111 */
112 public void setViewId(String viewId) {
113
114 this.viewId = viewId;
115
116 }
117
118
119 }