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