KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > woody > 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.woody.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 30932 2004-07-29 17:35:38Z vgritsenko $
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
40     private Collection JavaDoc contacts = new ArrayList JavaDoc();
41     private Collection JavaDoc drinks = new ArrayList JavaDoc();
42
43     /**
44      * @return Returns the sex.
45      */

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

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