01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.forms.samples.dreamteam;
18:
19: /**
20: * TeamMember
21: */
22: public class TeamMember {
23: private String memberId = null;
24: private String name = null;
25: private String position = null;
26: private String country = null;
27:
28: public TeamMember() {
29: super ();
30: }
31:
32: public String getMemberId() {
33: return memberId;
34: }
35:
36: public void setMemberId(String memberID) {
37: this .memberId = memberID;
38: }
39:
40: public String getName() {
41: return name;
42: }
43:
44: public String getLastName() {
45: if (name == null) {
46: return "Name not set!";
47: }
48: String lastName = name.substring(name.indexOf(" ") + 1);
49: if (lastName.length() == 0) {
50: lastName = name;
51: }
52: return lastName;
53: }
54:
55: public void setName(String name) {
56: this .name = name;
57: }
58:
59: public String getPosition() {
60: return position;
61: }
62:
63: public void setPosition(String profession) {
64: this .position = profession;
65: }
66:
67: public String getCountry() {
68: return country;
69: }
70:
71: public void setCountry(String country) {
72: this .country = country;
73: }
74:
75: public String toString() {
76: String result = "<member id='" + memberId + "'><name>" + name
77: + "</name><position>" + position
78: + "</position><country>" + country
79: + "</country></member>";
80: return result;
81: }
82:
83: }
|