KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > digester > Address


1 /* $Id: Address.java 155412 2005-02-26 12:58:36Z dirkv $
2  *
3  * Copyright 2001-2004 The Apache Software Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * 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
18 package org.apache.commons.digester;
19
20
21 /**
22  * Bean for Digester testing.
23  */

24
25
26 public class Address {
27
28     public Address() {
29         this("My Street", "My City", "US", "MyZip");
30     }
31
32     public Address(String JavaDoc street, String JavaDoc city, String JavaDoc state, String JavaDoc zipCode) {
33         super();
34         setStreet(street);
35         setCity(city);
36         setState(state);
37         setZipCode(zipCode);
38     }
39
40     private String JavaDoc city = null;
41
42     public String JavaDoc getCity() {
43         return (this.city);
44     }
45
46     public void setCity(String JavaDoc city) {
47         this.city = city;
48     }
49
50     private String JavaDoc state = null;
51
52     public String JavaDoc getState() {
53         return (this.state);
54     }
55
56     public void setState(String JavaDoc state) {
57         this.state = state;
58     }
59
60     private String JavaDoc street = null;
61
62     public String JavaDoc getStreet() {
63         return (this.street);
64     }
65
66     public void setStreet(String JavaDoc street) {
67         this.street = street;
68     }
69
70     private String JavaDoc type = null;
71
72     public String JavaDoc getType() {
73         return (this.type);
74     }
75
76     public void setType(String JavaDoc type) {
77         this.type = type;
78     }
79
80     private String JavaDoc zipCode = null;
81
82     public String JavaDoc getZipCode() {
83         return (this.zipCode);
84     }
85
86     public void setZipCode(String JavaDoc zipCode) {
87         this.zipCode = zipCode;
88     }
89
90     public void setEmployee(Employee employee) {
91         employee.addAddress(this);
92     }
93
94     public String JavaDoc toString() {
95         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("Address[");
96         sb.append("street=");
97         sb.append(street);
98         sb.append(", city=");
99         sb.append(city);
100         sb.append(", state=");
101         sb.append(state);
102         sb.append(", zipCode=");
103         sb.append(zipCode);
104         sb.append("]");
105         return (sb.toString());
106     }
107
108 }
109
Popular Tags