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.woody.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 433543 2006-08-22 06:22:54Z 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:
041: private Collection contacts = new ArrayList();
042: private Collection drinks = new ArrayList();
043:
044: /**
045: * @return Returns the sex.
046: */
047: public Sex getSex() {
048: return sex;
049: }
050:
051: /**
052: * @param sex The sex to set.
053: */
054: public void setSex(Sex sex) {
055: this .sex = sex;
056: }
057:
058: public Form2Bean() {
059: }
060:
061: public String getEmail() {
062: return email;
063: }
064:
065: public void setEmail(String email) {
066: this .email = email;
067: }
068:
069: public String getPhoneCountry() {
070: return phoneCountry;
071: }
072:
073: public void setPhoneCountry(String phoneCountry) {
074: this .phoneCountry = phoneCountry;
075: }
076:
077: public String getPhoneZone() {
078: return phoneZone;
079: }
080:
081: public void setPhoneZone(String phoneZone) {
082: this .phoneZone = phoneZone;
083: }
084:
085: public String getPhoneNumber() {
086: return phoneNumber;
087: }
088:
089: public void setPhoneNumber(String phoneNumber) {
090: this .phoneNumber = phoneNumber;
091: }
092:
093: public String getIpAddress() {
094: return ipAddress;
095: }
096:
097: public void setIpAddress(String ipAddress) {
098: this .ipAddress = ipAddress;
099: }
100:
101: public Date getBirthday() {
102: return birthday;
103: }
104:
105: public void setBirthday(Date 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 Collection getDrinks() {
126: return drinks;
127: }
128:
129: public void setDrinks(Collection drinks) {
130: this .drinks = drinks;
131: }
132:
133: public void addDrink(String drink) {
134: drinks.add(drink);
135: }
136:
137: public Collection getContacts() {
138: return contacts;
139: }
140:
141: public void setContacts(Collection contacts) {
142: this .contacts = contacts;
143: }
144:
145: public void addContact(Contact contact) {
146: contacts.add(contact);
147: }
148:
149: public String toString() {
150: return "email = " + email + ", phoneCountry = " + phoneCountry
151: + ", phoneZone = " + phoneZone + ", phoneNumber = "
152: + phoneNumber + ", ipAddress = " + ipAddress
153: + ", contacts = " + contacts.toString();
154: }
155: }
|