001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.cocoon.forms.samples;
018:
019: import java.util.ArrayList;
020: import java.util.Collection;
021: import java.util.Date;
022:
023: /**
024: * Sample bean used in the form2 binding demo.
025: *
026: * @version $Id: Form2Bean.java 449149 2006-09-23 03:58:05Z crossley $
027: */
028: public class Form2Bean {
029: private String email;
030:
031: private String phoneCountry;
032: private String phoneZone;
033: private String phoneNumber;
034:
035: private String ipAddress;
036: private Date birthday;
037: private int aNumber;
038: private boolean choose;
039: private Sex sex;
040: private Boolean enable;
041:
042: private Collection contacts = new ArrayList();
043: private Collection drinks = new ArrayList();
044:
045: /**
046: * @return Returns the sex.
047: */
048: public Sex getSex() {
049: return sex;
050: }
051:
052: /**
053: * @param sex The sex to set.
054: */
055: public void setSex(Sex sex) {
056: this .sex = sex;
057: }
058:
059: public Form2Bean() {
060: }
061:
062: public String getEmail() {
063: return email;
064: }
065:
066: public void setEmail(String email) {
067: this .email = email;
068: }
069:
070: public String getPhoneCountry() {
071: return phoneCountry;
072: }
073:
074: public void setPhoneCountry(String phoneCountry) {
075: this .phoneCountry = phoneCountry;
076: }
077:
078: public String getPhoneZone() {
079: return phoneZone;
080: }
081:
082: public void setPhoneZone(String phoneZone) {
083: this .phoneZone = phoneZone;
084: }
085:
086: public String getPhoneNumber() {
087: return phoneNumber;
088: }
089:
090: public void setPhoneNumber(String phoneNumber) {
091: this .phoneNumber = phoneNumber;
092: }
093:
094: public String getIpAddress() {
095: return ipAddress;
096: }
097:
098: public void setIpAddress(String ipAddress) {
099: this .ipAddress = ipAddress;
100: }
101:
102: public Date getBirthday() {
103: return birthday;
104: }
105:
106: public void setBirthday(Date birthday) {
107: this .birthday = birthday;
108: }
109:
110: public int getaNumber() {
111: return aNumber;
112: }
113:
114: public void setaNumber(int aNumber) {
115: this .aNumber = aNumber;
116: }
117:
118: public boolean isChoose() {
119: return choose;
120: }
121:
122: public void setChoose(boolean choose) {
123: this .choose = choose;
124: }
125:
126: public Boolean getEnable() {
127: return enable;
128: }
129:
130: public void setEnable(Boolean enable) {
131: this .enable = enable;
132: }
133:
134: public Collection getDrinks() {
135: return drinks;
136: }
137:
138: public void setDrinks(Collection drinks) {
139: this .drinks = drinks;
140: }
141:
142: public void addDrink(String drink) {
143: drinks.add(drink);
144: }
145:
146: public Collection getContacts() {
147: return contacts;
148: }
149:
150: public void setContacts(Collection contacts) {
151: this .contacts = contacts;
152: }
153:
154: public void addContact(Contact contact) {
155: contacts.add(contact);
156: }
157:
158: public String toString() {
159: return "email = " + email + ", phoneCountry = " + phoneCountry
160: + ", phoneZone = " + phoneZone + ", phoneNumber = "
161: + phoneNumber + ", ipAddress = " + ipAddress
162: + ", contacts = " + contacts.toString();
163: }
164: }
|