KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > forms > samples > Form2Bean


1 /*
2  * Copyright 1999-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 package org.apache.cocoon.forms.samples;
17
18 import java.util.ArrayList JavaDoc;
19 import java.util.Collection JavaDoc;
20 import java.util.Date JavaDoc;
21
22 /**
23  * Sample bean used in the form2 binding demo.
24  *
25  * @version $Id: Form2Bean.java 161264 2005-04-14 12:32:26Z sylvain $
26  */

27 public class Form2Bean {
28     private String JavaDoc email;
29
30     private String JavaDoc phoneCountry;
31     private String JavaDoc phoneZone;
32     private String JavaDoc phoneNumber;
33
34     private String JavaDoc ipAddress;
35     private Date JavaDoc birthday;
36     private int aNumber;
37     private boolean choose;
38     private Sex sex;
39     private Boolean JavaDoc enable;
40
41     private Collection JavaDoc contacts = new ArrayList JavaDoc();
42     private Collection JavaDoc drinks = new ArrayList JavaDoc();
43
44     /**
45      * @return Returns the sex.
46      */

47     public Sex getSex() {
48         return sex;
49     }
50
51     /**
52      * @param sex The sex to set.
53      */

54     public void setSex(Sex sex) {
55         this.sex = sex;
56     }
57
58     public Form2Bean() {
59     }
60
61     public String JavaDoc getEmail() {
62         return email;
63     }
64
65     public void setEmail(String JavaDoc email) {
66         this.email = email;
67     }
68
69     public String JavaDoc getPhoneCountry() {
70         return phoneCountry;
71     }
72
73     public void setPhoneCountry(String JavaDoc phoneCountry) {
74         this.phoneCountry = phoneCountry;
75     }
76
77     public String JavaDoc getPhoneZone() {
78         return phoneZone;
79     }
80
81     public void setPhoneZone(String JavaDoc phoneZone) {
82         this.phoneZone = phoneZone;
83     }
84
85     public String JavaDoc getPhoneNumber() {
86         return phoneNumber;
87     }
88
89     public void setPhoneNumber(String JavaDoc phoneNumber) {
90         this.phoneNumber = phoneNumber;
91     }
92
93     public String JavaDoc getIpAddress() {
94         return ipAddress;
95     }
96
97     public void setIpAddress(String JavaDoc ipAddress) {
98         this.ipAddress = ipAddress;
99     }
100
101     public Date JavaDoc getBirthday() {
102         return birthday;
103     }
104
105     public void setBirthday(Date JavaDoc birthday) {
106         this.birthday = birthday;
107     }
108
109     public int getaNumber() {
110         return aNumber;
111     }
112
113     public void setaNumber(int aNumber) {
114         this.aNumber = aNumber;
115     }
116
117     public boolean isChoose() {
118         return choose;
119     }
120
121     public void setChoose(boolean choose) {
122         this.choose = choose;
123     }
124     
125     public Boolean JavaDoc getEnable() {
126         return enable;
127     }
128
129     public void setEnable(Boolean JavaDoc enable) {
130         this.enable = enable;
131     }
132
133     public Collection JavaDoc getDrinks() {
134         return drinks;
135     }
136
137     public void setDrinks(Collection JavaDoc drinks) {
138         this.drinks = drinks;
139     }
140
141     public void addDrink(String JavaDoc drink) {
142         drinks.add(drink);
143     }
144
145     public Collection JavaDoc getContacts() {
146         return contacts;
147     }
148
149     public void setContacts(Collection JavaDoc contacts) {
150         this.contacts = contacts;
151     }
152
153     public void addContact(Contact contact) {
154         contacts.add(contact);
155     }
156
157     public String JavaDoc toString() {
158         return "email = " + email + ", phoneCountry = " + phoneCountry + ", phoneZone = " + phoneZone + ", phoneNumber = " + phoneNumber + ", ipAddress = " + ipAddress + ", contacts = " + contacts.toString();
159     }
160 }
161
Popular Tags