KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > pageflow > config > PageFlowActionForward


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Header:$
17  */

18 package org.apache.beehive.netui.pageflow.config;
19
20 import org.apache.struts.action.ActionForward;
21
22 import java.util.ArrayList JavaDoc;
23 import java.io.Serializable JavaDoc;
24
25
26 /**
27  * Bean class to handle our extensions to the Struts <forward> element.
28  */

29 public class PageFlowActionForward extends ActionForward
30 {
31     private boolean _isNestedReturn;
32     private boolean _isReturnToPage;
33     private boolean _isReturnToAction;
34     private String JavaDoc _returnFormType;
35     private String JavaDoc _returnFormMember;
36     private boolean _hasExplicitRedirectValue;
37     private ArrayList JavaDoc _actionOutputs;
38     private boolean _restoreQueryString;
39     private boolean _externalRedirect = false;
40
41
42     public boolean isNestedReturn()
43     {
44         return _isNestedReturn;
45     }
46
47     public void setNestedReturn( boolean nestedReturn )
48     {
49         _isNestedReturn = nestedReturn;
50     }
51
52     public boolean isReturnToPage()
53     {
54         return _isReturnToPage;
55     }
56
57     public void setReturnToPage( boolean returnToPage )
58     {
59         _isReturnToPage = returnToPage;
60     }
61
62     public boolean isReturnToAction()
63     {
64         return _isReturnToAction;
65     }
66
67     public void setReturnToAction( boolean returnToAction )
68     {
69         _isReturnToAction = returnToAction;
70     }
71
72     public String JavaDoc getReturnFormType()
73     {
74         return _returnFormType;
75     }
76
77     public void setReturnFormType( String JavaDoc returnFormType )
78     {
79         _returnFormType = returnFormType;
80     }
81
82     public String JavaDoc getReturnFormMember()
83     {
84         return _returnFormMember;
85     }
86
87     public void setReturnFormMember( String JavaDoc returnFormMember )
88     {
89         _returnFormMember = returnFormMember;
90     }
91
92     public boolean hasExplicitRedirectValue()
93     {
94         return _hasExplicitRedirectValue;
95     }
96
97     public void setHasExplicitRedirectValue( boolean hasExplicitRedirectValue )
98     {
99         _hasExplicitRedirectValue = hasExplicitRedirectValue;
100     }
101
102     public boolean isRestoreQueryString()
103     {
104         return _restoreQueryString;
105     }
106
107     public void setRestoreQueryString( boolean restoreQueryString )
108     {
109         _restoreQueryString = restoreQueryString;
110     }
111
112     public boolean isExternalRedirect()
113     {
114         return _externalRedirect;
115     }
116
117     public void setExternalRedirect(boolean externalRedirect)
118     {
119         _externalRedirect = externalRedirect;
120     }
121
122     public static class ActionOutput implements Serializable JavaDoc
123     {
124         private String JavaDoc _name;
125         private String JavaDoc _type;
126         private boolean _isNullable;
127         
128         public ActionOutput( String JavaDoc name, String JavaDoc type, boolean isNullable )
129         {
130             _name = name;
131             _type = type;
132             _isNullable = isNullable;
133         }
134
135         public String JavaDoc getName()
136         {
137             return _name;
138         }
139
140         public String JavaDoc getType()
141         {
142             return _type;
143         }
144
145         public boolean getNullable()
146         {
147             return _isNullable;
148         }
149     }
150
151     public void setActionOutputCount( String JavaDoc count )
152     {
153         setActionOutputCount( Integer.parseInt( count ) );
154     }
155     
156     public String JavaDoc getActionOutputCount()
157     {
158         return new Integer JavaDoc( _actionOutputs != null ? _actionOutputs.size() : 0 ).toString();
159     }
160     
161     public void setActionOutputCount( int count )
162     {
163         if ( _actionOutputs == null )
164         {
165             _actionOutputs = new ArrayList JavaDoc( count );
166         }
167         else
168         {
169             _actionOutputs.ensureCapacity( count );
170         }
171         
172         while ( _actionOutputs.size() < count )
173         {
174             _actionOutputs.add( null );
175         }
176     }
177     
178     protected void setActionOutput( int n, String JavaDoc concatenatedVals )
179     {
180         setActionOutputCount( n + 1 );
181         String JavaDoc[] vals = concatenatedVals.split( "\\|" );
182         assert vals.length == 3 : vals.length;
183         _actionOutputs.set( n, new ActionOutput( vals[2], vals[0], Boolean.valueOf( vals[1] ).booleanValue() ) );
184     }
185     
186     public ActionOutput[] getActionOutputs()
187     {
188         if ( _actionOutputs == null )
189         {
190             return new ActionOutput[0];
191         }
192         
193         return ( ActionOutput[] ) _actionOutputs.toArray( new ActionOutput[ _actionOutputs.size() ] );
194     }
195     
196     public void setActionOutput0( String JavaDoc str )
197     {
198         setActionOutput( 0, str );
199     }
200     
201     public void setActionOutput1( String JavaDoc str )
202     {
203         setActionOutput( 1, str );
204     }
205     
206     public void setActionOutput2( String JavaDoc str )
207     {
208         setActionOutput( 2, str );
209     }
210     
211     public void setActionOutput3( String JavaDoc str )
212     {
213         setActionOutput( 3, str );
214     }
215     
216     public void setActionOutput4( String JavaDoc str )
217     {
218         setActionOutput( 4, str );
219     }
220     
221     public void setActionOutput5( String JavaDoc str )
222     {
223         setActionOutput( 5, str );
224     }
225     
226     public void setActionOutput6( String JavaDoc str )
227     {
228         setActionOutput( 6, str );
229     }
230     
231     public void setActionOutput7( String JavaDoc str )
232     {
233         setActionOutput( 7, str );
234     }
235     
236     public void setActionOutput8( String JavaDoc str )
237     {
238         setActionOutput( 8, str );
239     }
240     
241     public void setActionOutput9( String JavaDoc str )
242     {
243         setActionOutput( 9, str );
244     }
245     
246     public void setActionOutput10( String JavaDoc str )
247     {
248         setActionOutput( 10, str );
249     }
250     
251     public void setActionOutput11( String JavaDoc str )
252     {
253         setActionOutput( 11, str );
254     }
255     
256     public void setActionOutput12( String JavaDoc str )
257     {
258         setActionOutput( 12, str );
259     }
260     
261     public void setActionOutput13( String JavaDoc str )
262     {
263         setActionOutput( 13, str );
264     }
265     
266     public void setActionOutput14( String JavaDoc str )
267     {
268         setActionOutput( 14, str );
269     }
270     
271     public void setActionOutput15( String JavaDoc str )
272     {
273         setActionOutput( 15, str );
274     }
275     
276     public void setActionOutput16( String JavaDoc str )
277     {
278         setActionOutput( 16, str );
279     }
280     
281     public void setActionOutput17( String JavaDoc str )
282     {
283         setActionOutput( 17, str );
284     }
285     
286     public void setActionOutput18( String JavaDoc str )
287     {
288         setActionOutput( 18, str );
289     }
290     
291     public void setActionOutput19( String JavaDoc str )
292     {
293         setActionOutput( 19, str );
294     }
295 }
296
Popular Tags