1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.beanutils.priv;
19
20
21 /**
22 * Bean that has a private constructor that exposes properties via
23 * various mechanisms (based on property name):
24 * <ul>
25 * <li><strong>foo</strong> - Via direct public method
26 * <li><strong>bar</strong> - Via directly implemented interface
27 * <li><strong>baz</strong> - Via indirectly implemented interface
28 * </ul>
29 *
30 * @author Craig R. McClanahan
31 * @version $Revision: 1.6 $ $Date: 2004/02/28 13:18:37 $
32 */
33
34 class PrivateBean implements PrivateDirect {
35
36
37
38
39
40 /**
41 * Package private constructor - can only use factory method to create
42 * beans.
43 */
44 PrivateBean() {
45
46 super();
47
48 }
49
50
51
52
53
54 /**
55 * A directly implemented property.
56 */
57 private String foo = "This is foo";
58
59 public String getFoo() {
60
61 return (this.foo);
62
63 }
64
65
66 /**
67 * A property accessible via a directly implemented interface.
68 */
69 private String bar = "This is bar";
70
71 public String getBar() {
72
73 return (this.bar);
74
75 }
76
77
78 /**
79 * A method accessible via a directly implemented interface.
80 */
81 public String methodBar(String in) {
82
83 return (in);
84
85 }
86
87
88 /**
89 * A property accessible via an indirectly implemented interface.
90 */
91 private String baz = "This is baz";
92
93 public String getBaz() {
94
95 return (this.baz);
96
97 }
98
99
100 /**
101 * A method accessible via an indirectly implemented interface.
102 */
103 public String methodBaz(String in) {
104
105 return (in);
106
107 }
108
109
110 }