KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > jmx > browser > web > form > SearchForm


1 /*
2
3  * EJTools, the Enterprise Java Tools
4
5  *
6
7  * Distributable under LGPL license.
8
9  * See terms of license at www.gnu.org.
10
11  */

12
13 package org.ejtools.jmx.browser.web.form;
14
15
16
17 import javax.servlet.http.HttpServletRequest JavaDoc;
18
19
20
21 import org.apache.struts.action.ActionErrors;
22
23 import org.apache.struts.action.ActionForm;
24
25 import org.apache.struts.action.ActionMapping;
26
27
28
29 /**
30
31  * Description of the Class
32
33  *
34
35  * @author letiemble
36
37  * @created 13 février 2002
38
39  * @version $Revision: 1.6 $
40
41  * @todo Javadoc to complete
42
43  */

44
45 public class SearchForm extends ActionForm
46
47 {
48
49    /** Description of the Field */
50
51    protected String JavaDoc attribute = "";
52
53    /** Description of the Field */
54
55    protected String JavaDoc filter = "*:*";
56
57    /** Description of the Field */
58
59    protected String JavaDoc query = "";
60
61    /** Description of the Field */
62
63    protected String JavaDoc type = "java.lang.String";
64
65    /** Description of the Field */
66
67    protected String JavaDoc value = "";
68
69
70
71
72
73    /** Constructor for the ConnectForm object */
74
75    public SearchForm() { }
76
77
78
79
80
81    /**
82
83     * Gets the attribute attribute of the SearchForm object
84
85     *
86
87     * @return The attribute value
88
89     */

90
91    public String JavaDoc getAttribute()
92
93    {
94
95       return this.attribute;
96
97    }
98
99
100
101
102
103    /**
104
105     * Getter for the factory attribute
106
107     *
108
109     * @return The value of factory attribute
110
111     */

112
113    public String JavaDoc getFilter()
114
115    {
116
117       return this.filter;
118
119    }
120
121
122
123
124
125    /**
126
127     * Gets the query attribute of the SearchForm object
128
129     *
130
131     * @return The query value
132
133     */

134
135    public String JavaDoc getQuery()
136
137    {
138
139       return this.query;
140
141    }
142
143
144
145
146
147    /**
148
149     * Gets the type attribute of the SearchForm object
150
151     *
152
153     * @return The type value
154
155     */

156
157    public String JavaDoc getType()
158
159    {
160
161       return this.type;
162
163    }
164
165
166
167
168
169    /**
170
171     * Gets the value attribute of the SearchForm object
172
173     *
174
175     * @return The value value
176
177     */

178
179    public String JavaDoc getValue()
180
181    {
182
183       return this.value;
184
185    }
186
187
188
189
190
191    /**
192
193     * Description of the Method
194
195     *
196
197     * @param mapping Description of the Parameter
198
199     * @param request Description of the Parameter
200
201     */

202
203    public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request)
204
205    {
206
207       this.filter = "*:*";
208
209    }
210
211
212
213
214
215    /**
216
217     * Sets the attribute attribute of the SearchForm object
218
219     *
220
221     * @param attribute The new attribute value
222
223     */

224
225    public void setAttribute(String JavaDoc attribute)
226
227    {
228
229       this.attribute = attribute;
230
231    }
232
233
234
235
236
237    /**
238
239     * Setter for the factory attribute
240
241     *
242
243     * @param filter The new filter value
244
245     */

246
247    public void setFilter(String JavaDoc filter)
248
249    {
250
251       this.filter = filter;
252
253    }
254
255
256
257
258
259    /**
260
261     * Sets the query attribute of the SearchForm object
262
263     *
264
265     * @param query The new query value
266
267     */

268
269    public void setQuery(String JavaDoc query)
270
271    {
272
273       this.query = query;
274
275    }
276
277
278
279
280
281    /**
282
283     * Sets the type attribute of the SearchForm object
284
285     *
286
287     * @param type The new type value
288
289     */

290
291    public void setType(String JavaDoc type)
292
293    {
294
295       this.type = type;
296
297    }
298
299
300
301
302
303    /**
304
305     * Sets the value attribute of the SearchForm object
306
307     *
308
309     * @param value The new value value
310
311     */

312
313    public void setValue(String JavaDoc value)
314
315    {
316
317       this.value = value;
318
319    }
320
321
322
323
324
325    /**
326
327     * Description of the Method
328
329     *
330
331     * @param mapping Description of the Parameter
332
333     * @param request Description of the Parameter
334
335     * @return Description of the Returned Value
336
337     */

338
339    public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request)
340
341    {
342
343       ActionErrors errors = new ActionErrors();
344
345
346
347       /*
348
349        * if ((filter == null) || (filter.length() < 1))
350
351        * {
352
353        * errors.add("filter", new ActionError("web.error.filter.required"));
354
355        * }
356
357        */

358
359       return errors;
360
361    }
362
363 }
364
365
Popular Tags