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