1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.beanutils;
19
20
21 import java.util.ArrayList;
22 import java.util.HashMap;
23 import java.util.List;
24 import java.util.Map;
25
26
27 /**
28 * Specialist test bean for complex nested properties.
29 *
30 * @author Robert Burrell Donkin
31 * @version $Revision: 1.4 $ $Date: 2004/02/28 13:18:36 $
32 */
33
34 public class NestedTestBean {
35
36
37
38 public NestedTestBean(String name) {
39 setName(name);
40 }
41
42
43
44
45 private String name;
46
47 public String getName() {
48 return name;
49 }
50
51 public void setName(String name) {
52 this.name = name;
53 }
54
55
56 private String testString = "NOT SET";
57
58 public String getTestString() {
59 return testString;
60 }
61
62 public void setTestString(String testString) {
63 this.testString = testString;
64 }
65
66
67 private boolean testBoolean = false;
68
69 public boolean getTestBoolean() {
70 return testBoolean;
71 }
72
73 public void setTestBoolean(boolean testBoolean) {
74 this.testBoolean = testBoolean;
75 }
76
77
78 private NestedTestBean indexedBeans[];
79
80 public void init() {
81 indexedBeans = new NestedTestBean[5];
82 indexedBeans[0] = new NestedTestBean("Bean@0");
83 indexedBeans[1] = new NestedTestBean("Bean@1");
84 indexedBeans[2] = new NestedTestBean("Bean@2");
85 indexedBeans[3] = new NestedTestBean("Bean@3");
86 indexedBeans[4] = new NestedTestBean("Bean@4");
87
88 simpleBean = new NestedTestBean("Simple Property Bean");
89 };
90
91 public NestedTestBean getIndexedProperty(int index) {
92 return (this.indexedBeans[index]);
93 }
94
95 public void setIndexedProperty(int index, NestedTestBean value) {
96 this.indexedBeans[index] = value;
97 }
98
99 private NestedTestBean simpleBean;
100
101 public NestedTestBean getSimpleBeanProperty() {
102 return simpleBean;
103 }
104
105
106
107 }