1   /*
2    * Copyright 2002,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  package org.apache.commons.jelly.util;
17  
18  import java.util.ArrayList;
19  import java.util.Iterator;
20  import java.util.List;
21  
22  /***
23   * A sample bean that we can construct via Jelly tags
24   *
25   * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
26   * @version $Revision: 1.1 $
27   */
28  public class Customer {
29  
30      private String name;
31      private String city;
32      private String location;
33  
34  
35      public Customer() {
36      }
37  
38      public Customer(String name) {
39          setName(name);
40      }
41  
42      public Customer(String name, String city) {
43          setName(name);
44          setCity(city);
45      }
46  
47      public Customer(Customer cust) {
48          setName(cust.getName());
49          setCity(cust.getCity());
50          setLocation(cust.getLocation());
51      }
52  
53      public String toString() {
54          return super.toString() + "[name=" + name + ";city=" + city + "]";
55      }
56  
57      /***
58       * Returns the city.
59       * @return String
60       */
61      public String getCity() {
62          return city;
63      }
64  
65      /***
66       * Returns the location.
67       * @return String
68       */
69      public String getLocation() {
70          return location;
71      }
72  
73      /***
74       * Returns the name.
75       * @return String
76       */
77      public String getName() {
78          return name;
79      }
80  
81      /***
82       * Sets the city.
83       * @param city The city to set
84       */
85      public void setCity(String city) {
86          this.city = city;
87      }
88  
89      /***
90       * Sets the location.
91       * @param location The location to set
92       */
93      public void setLocation(String location) {
94          this.location = location;
95      }
96  
97      /***
98       * Sets the name.
99       * @param name The name to set
100      */
101     public void setName(String name) {
102         this.name = name;
103     }
104 }