KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > standard > examples > beans > Address


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.taglibs.standard.examples.beans;
18
19 /**
20  * Object that represents a Customer.
21  *
22  * @author Pierre Delisle
23  * @version $Revision: 1.2 $ $Date: 2004/02/28 01:01:41 $
24  */

25
26 public class Address {
27     
28     //*********************************************************************
29
// Instance variables
30

31     /** Holds value of property line1. */
32     private String JavaDoc line1;
33     
34     /** Holds value of property line2. */
35     private String JavaDoc line2;
36     
37     /** Holds value of property city. */
38     private String JavaDoc city;
39     
40     /** Holds value of property zip. */
41     private String JavaDoc zip;
42
43     /** Holds value of property state. */
44     private String JavaDoc state;
45     
46     /** Holds value of property country. */
47     private String JavaDoc country;
48     
49     //*********************************************************************
50
// Constructor
51

52     public Address(String JavaDoc line1, String JavaDoc line2, String JavaDoc city,
53     String JavaDoc state, String JavaDoc zip, String JavaDoc country) {
54         setLine1(line1);
55         setLine2(line2);
56         setCity(city);
57         setState(state);
58         setZip(zip);
59         setCountry(country);
60     }
61     
62     //*********************************************************************
63
// Accessors
64

65     /** Getter for property line1.
66      * @return Value of property line1.
67      */

68     public String JavaDoc getLine1() {
69         return line1;
70     }
71     
72     /** Setter for property line1.
73      * @param line1 New value of property line1.
74      */

75     public void setLine1(String JavaDoc line1) {
76         this.line1 = line1;
77     }
78     
79     /** Getter for property line2.
80      * @return Value of property line2.
81      */

82     public String JavaDoc getLine2() {
83         return line2;
84     }
85     
86     /** Setter for property line2.
87      * @param line2 New value of property line2.
88      */

89     public void setLine2(String JavaDoc line2) {
90         this.line2 = line2;
91     }
92     
93     /** Getter for property city.
94      * @return Value of property city.
95      */

96     public String JavaDoc getCity() {
97         return city;
98     }
99     
100     /** Setter for property city.
101      * @param city New value of property city.
102      */

103     public void setCity(String JavaDoc city) {
104         this.city = city;
105     }
106     
107     /** Getter for property zip.
108      * @return Value of property zip.
109      */

110     public String JavaDoc getZip() {
111         return zip;
112     }
113     
114     /** Setter for property zip.
115      * @param zip New value of property zip.
116      */

117     public void setZip(String JavaDoc zip) {
118         this.zip = zip;
119     }
120     
121     /** Getter for property country.
122      * @return Value of property country.
123      */

124     public String JavaDoc getCountry() {
125         return country;
126     }
127     
128     /** Setter for property country.
129      * @param country New value of property country.
130      */

131     public void setCountry(String JavaDoc country) {
132         this.country = country;
133     }
134     
135     /** Getter for property state.
136      * @return Value of property state.
137      */

138     public String JavaDoc getState() {
139         return state;
140     }
141     
142     /** Setter for property state.
143      * @param state New value of property state.
144      */

145     public void setState(String JavaDoc state) {
146         this.state = state;
147     }
148     
149     //*********************************************************************
150
// Utility Methods
151

152     /**
153      * Return a String representation of this object.
154      */

155     public String JavaDoc toString() {
156         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
157         sb.append(line1).append(" ");
158         sb.append(city).append(" ");
159         sb.append(country);
160         return (sb.toString());
161     }
162 }
163
Popular Tags