KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xpetstore > web > struts > action > category > CategoryForm


1 package xpetstore.web.struts.action.category;
2
3 import java.util.Collection JavaDoc;
4
5 import xpetstore.domain.catalog.ejb.Category;
6
7 import xpetstore.web.struts.action.*;
8
9
10 /**
11  * @author <a HREF="mailto:tchbansi@sourceforge.net">Herve Tchepannou</a>
12  *
13  * @struts.form
14  * name="categoryForm"
15  */

16 public class CategoryForm
17     extends BaseForm
18 {
19     //~ Instance fields --------------------------------------------------------
20

21     private String JavaDoc _categoryId = "";
22     private Category _category = new Category( );
23     private Collection JavaDoc _products;
24
25     public CategoryForm()
26     {
27     }
28
29     /**
30      * @return String
31      */

32     public String JavaDoc getCategoryId( )
33     {
34         return _categoryId;
35     }
36
37     /**
38      * @return CategoryValue
39      */

40     public Category getCategory( )
41     {
42        if (_category == null)
43           _category = new Category();
44        System.out.println("!! CategoryForm.getCategory " + _category);
45         return _category;
46     }
47
48     /**
49      * @return Collection
50      */

51     public Collection JavaDoc getProducts( )
52     {
53         return _products;
54     }
55
56     /**
57      * Sets the categoryId.
58      * @param categoryId The categoryId to set
59      */

60     public void setCategoryId( String JavaDoc categoryId )
61     {
62         _categoryId = categoryId;
63     }
64
65     /**
66      * Sets the categoryValue.
67      * @param categoryValue The categoryValue to set
68      */

69     public void setCategory( Category category )
70     {
71         _category = category;
72     }
73
74     /**
75      * Sets the productValues.
76      * @param productValues The productValues to set
77      */

78     public void setProducts( Collection JavaDoc products )
79     {
80         _products = products;
81     }
82 }
83
Popular Tags