KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > hibernate > Address


1 package test.hibernate;
2
3 import java.util.Date JavaDoc;
4
5
6 /**
7  * This class is used to test generating Struts Forms
8  * using <actionform> as well as one-to-one validation
9  * mappings
10  *
11  * @author Matt Raible
12  *
13  * @struts.form name="cityForm"
14  * extends="org.apache.struts.validator.ValidatorForm"
15  * @struts.form name="stateForm"
16  */

17 public class Address {
18     private String JavaDoc city;
19     private String JavaDoc state;
20     private Boolean JavaDoc usCitizen;
21     private Date JavaDoc startDate;
22
23     /**
24     * @struts.form-field form-name="cityForm"
25      * Returns the city.
26      * @return String
27      */

28     public String JavaDoc getCity() {
29         return city;
30     }
31
32     /**
33      * @return String
34     * @struts.form-field form-name="stateForm"
35      */

36     public String JavaDoc getState() {
37         return state;
38     }
39
40     /**
41      * Sets the city.
42      * @param city The city to set
43      */

44     public void setCity(String JavaDoc first) {
45         this.city = first;
46     }
47
48     /**
49      * Sets the state.
50      * @param state The state to set
51      */

52     public void setState(String JavaDoc last) {
53         this.state = last;
54     }
55
56     /**
57      * @struts.form-field
58      * @struts.validator type="required"
59      */

60     public Boolean JavaDoc getUsCitizen() {
61         return usCitizen;
62     }
63
64     /**
65      * @spring.validator type="required"
66      * @return
67      */

68     public void setUsCitizen(Boolean JavaDoc citizen) {
69         this.usCitizen = citizen;
70     }
71     
72     /**
73      * @return Returns the startDate.
74      */

75     public Date JavaDoc getStartDate() {
76         return startDate;
77     }
78     
79     /**
80      * @param startDate The startDate to set.
81      * @spring.validator type="required"
82      */

83     public void setStartDate(Date JavaDoc startDate) {
84         this.startDate = startDate;
85     }
86 }
87
Popular Tags