01: // Copyright 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14:
15: package org.apache.tapestry.integration.app1.data;
16:
17: import org.apache.tapestry.beaneditor.Validate;
18:
19: public class RegistrationData {
20: private String _lastName;
21:
22: private String _firstName;
23:
24: private int _birthYear;
25:
26: private Sex _sex = Sex.MALE;
27:
28: private boolean _citizen;
29:
30: public String getFirstName() {
31: return _firstName;
32: }
33:
34: @Validate("required,minlength=5")
35: public String getLastName() {
36: return _lastName;
37: }
38:
39: @Validate("min=1900,max=2007")
40: public int getBirthYear() {
41: return _birthYear;
42: }
43:
44: public Sex getSex() {
45: return _sex;
46: }
47:
48: public boolean isCitizen() {
49: return _citizen;
50: }
51:
52: public void setBirthYear(int birthYear) {
53: _birthYear = birthYear;
54: }
55:
56: @Validate("required,minlength=3")
57: public void setFirstName(String firstName) {
58: _firstName = firstName;
59: }
60:
61: public void setLastName(String lastName) {
62: _lastName = lastName;
63: }
64:
65: public void setSex(Sex sex) {
66: _sex = sex;
67: }
68:
69: public void setCitizen(boolean citizen) {
70: _citizen = citizen;
71: }
72: }
|