1 package org.apache.commons.digester3.examples.api.addressbook;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 public class Address
24 {
25
26 private String type;
27
28 private String street;
29
30 private String city;
31
32 private String state;
33
34 private String zip;
35
36 private String country;
37
38 @Override
39 public String toString()
40 {
41 StringBuilder sb = new StringBuilder();
42 sb.append( " address (type " + type + ")\n" );
43 sb.append( " " + street + "\n" );
44 sb.append( " " + city + " " + state + " " + zip + "\n" );
45 sb.append( " " + country + "\n" );
46 return sb.toString();
47 }
48
49 public void print( java.io.PrintStream out, int indentAmount )
50 {
51 StringBuilder indentStr = new StringBuilder( indentAmount );
52 for ( ; indentAmount > 0; --indentAmount )
53 {
54 indentStr.append( ' ' );
55 }
56
57 out.print( indentStr );
58 out.print( "address type: " );
59 out.println( type );
60
61 out.print( indentStr );
62 out.println( " " + street );
63
64 out.print( indentStr );
65 out.println( " " + city + " " + state + " " + zip );
66
67 out.print( indentStr );
68 out.println( " " + country );
69 }
70
71
72
73
74 public String getStreet()
75 {
76 return street;
77 }
78
79
80
81
82
83
84 public void setStreet( String street )
85 {
86 this.street = street;
87 }
88
89
90
91
92 public String getCity()
93 {
94 return city;
95 }
96
97
98
99
100
101
102 public void setCity( String city )
103 {
104 this.city = city;
105 }
106
107
108
109
110 public String getState()
111 {
112 return state;
113 }
114
115
116
117
118
119
120 public void setState( String state )
121 {
122 this.state = state;
123 }
124
125
126
127
128 public String getZip()
129 {
130 return zip;
131 }
132
133
134
135
136
137
138 public void setZip( String zip )
139 {
140 this.zip = zip;
141 }
142
143
144
145
146 public String getCountry()
147 {
148 return country;
149 }
150
151
152
153
154
155
156 public void setCountry( String country )
157 {
158 this.country = country;
159 }
160
161
162
163
164 public String getType()
165 {
166 return type;
167 }
168
169
170
171
172
173
174 public void setType( String type )
175 {
176 this.type = type;
177 }
178
179 }