KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mdarad > framework > util > struts > action > FormActionForm


1 /*
2     Mdarad-Toolobox is a collection of tools for Architected RAD
3     (Rapid Application Development) based on an MDA approach.
4     The toolbox contains frameworks and generators for many environments
5     (JAVA, J2EE, Hibernate, .NET, C++, etc.) which allow to generate
6     applications from a design Model
7     Copyright (C) 2004-2005 Elapse Technologies Inc.
8
9     This library is free software; you can redistribute it and/or
10     modify it under the terms of the GNU General Public
11     License as published by the Free Software Foundation; either
12     version 2.1 of the License, or (at your option) any later version.
13
14     This library is distributed in the hope that it will be useful,
15     but WITHOUT ANY WARRANTY; without even the implied warranty of
16     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17     General Public License for more details.
18
19     You should have received a copy of the GNU General Public
20     License along with this library; if not, write to the Free Software
21     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */

23 package org.mdarad.framework.util.struts.action;
24
25 import javax.servlet.http.HttpServletRequest JavaDoc;
26 import javax.servlet.http.HttpServletResponse JavaDoc;
27
28
29 /**
30  * This class can be used by any struts application.
31  * It contains all the fields of a business object.
32  * @author Philippe Brouillette
33  * @version 1.0
34  * @since 1.4
35  */

36 public abstract class FormActionForm extends MdaradActionForm {
37
38     /**
39      * Property that keeps the business object associated to the
40      * actual form
41      */

42     private Object JavaDoc object;
43     
44     /**
45      * Getter for the business object associated to the form.
46      * IMPORTANT: It is recommended to create a getter returning
47      * the type of the object to ensure no type cast errors
48      * ex: public Transaction getTransactionObject()
49      * @return the business object associated to the form
50      */

51     public Object JavaDoc getObject() {
52         return object;
53     }
54
55     /**
56      * Setter for the business object associated to the form.
57      * IMPORTANT: It is hardly recommended to create a setter taking the
58      * type of the object to be set to ensure no type cast errors
59      * ex: public void setTransactionObject(Transaction tx) {
60      * setObject(tx);
61      * }
62      * OR to ensure an exception is thrown if the object is not
63      * of the right type by overloading this method
64      * @param object the business object to be set
65      */

66     public void setObject(Object JavaDoc object) {
67         this.object = object;
68     }
69
70     /**
71      * Method that initialize the search list form.
72      * @param request
73      * @param response
74      */

75     public void initialize(HttpServletRequest JavaDoc request,
76                                  HttpServletResponse JavaDoc response) {
77         // do nothing...
78
}
79 }
80
Popular Tags