01: /*
02: * Copyright 2004-2005 Fouad HAMDI.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.csvbeans.samples.strategy;
17:
18: import java.util.ArrayList;
19: import java.util.Iterator;
20: import java.util.List;
21:
22: /**
23: * @author Fouad Hamdi
24: *
25: */
26: public class BeanTag1 {
27: private String field1;
28:
29: private String field2;
30:
31: private List beans = new ArrayList();
32:
33: /**
34: * @return Returns the field1.
35: */
36: public String getField1() {
37: return field1;
38: }
39:
40: /**
41: * @param field1
42: * The field1 to set.
43: */
44: public void setField1(String field1) {
45: this .field1 = field1;
46: }
47:
48: /**
49: * @return Returns the field2.
50: */
51: public String getField2() {
52: return field2;
53: }
54:
55: /**
56: * @param field2
57: * The field2 to set.
58: */
59: public void setField2(String field2) {
60: this .field2 = field2;
61: }
62:
63: public String toString() {
64: String str = "";
65: if (!beans.isEmpty()) {
66: str = "\n\tThe bean contains BeanTag2 objects:\n";
67: for (Iterator it = beans.iterator(); it.hasNext();) {
68: str += it.next();
69: str += "\n";
70: }
71: }
72: return "BeanTag1\n\tField1: " + field1 + "\n\tField2: "
73: + field2 + str;
74: }
75:
76: /**
77: * @return Returns the beans.
78: */
79: public List getBeans() {
80: return beans;
81: }
82:
83: /**
84: * @param beans The beans to set.
85: */
86: public void setBeans(List beans) {
87: this.beans = beans;
88: }
89: }
|