1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package groovy.lang;
19
20 import java.lang.reflect.Constructor;
21 import java.lang.reflect.Method;
22 import java.util.List;
23 import java.util.Map;
24
25 import org.codehaus.groovy.ast.ClassNode;
26
27 /***
28 * @author John Wilson
29 *
30 */
31
32 public class DelegatingMetaClass extends MetaClass {
33 protected final MetaClass delegate;
34 public DelegatingMetaClass(final MetaClass delegate) {
35 super(delegate.getClass());
36
37 this.delegate = delegate;
38 }
39
40
41
42 public void addNewInstanceMethod(Method method) {
43 delegate.addNewInstanceMethod(method);
44 }
45
46
47
48 public void addNewStaticMethod(Method method) {
49 delegate.addNewStaticMethod(method);
50 }
51
52
53
54 public void checkInitialised() {
55 delegate.checkInitialised();
56 }
57
58
59
60 public MetaMethod pickMethod(Object object, String methodName, Object[] arguments) {
61 return delegate.pickMethod(object, methodName, arguments);
62 }
63
64
65
66 public MetaMethod pickMethod(String methodName, Class[] arguments) {
67 return delegate.pickMethod(methodName, arguments);
68 }
69
70
71
72 public Object getAttribute(Object object, String attribute) {
73 return delegate.getAttribute(object, attribute);
74 }
75
76
77
78 public ClassNode getClassNode() {
79 return delegate.getClassNode();
80 }
81
82
83
84 public List getMetaMethods() {
85 return delegate.getMetaMethods();
86 }
87
88
89
90 public List getMethods() {
91 return delegate.getMethods();
92 }
93
94
95
96 public List getProperties() {
97 return delegate.getProperties();
98 }
99
100
101
102 public Object getProperty(Object object, String property) {
103 return delegate.getProperty(object, property);
104 }
105
106
107
108 public Object invokeConstructor(Object[] arguments) {
109 return delegate.invokeConstructor(arguments);
110 }
111
112
113
114 public Object invokeConstructorAt(Class at, Object[] arguments) {
115 return delegate.invokeConstructorAt(at, arguments);
116 }
117
118
119
120 public Object invokeMethod(Object object, String methodName, Object arguments) {
121 return delegate.invokeMethod(object, methodName, arguments);
122 }
123
124
125
126 public Object invokeMethod(Object object, String methodName, Object[] arguments) {
127 return delegate.invokeMethod(object, methodName, arguments);
128 }
129
130
131
132 public Object invokeStaticMethod(Object object, String methodName, Object[] arguments) {
133 return delegate.invokeStaticMethod(object, methodName, arguments);
134 }
135
136
137
138 public Constructor retrieveConstructor(Class[] arguments) {
139 return delegate.retrieveConstructor(arguments);
140 }
141
142
143
144 public MetaMethod retrieveMethod(Object owner, String methodName, Object[] arguments) {
145 return delegate.retrieveMethod(owner, methodName, arguments);
146 }
147
148
149
150 public MetaMethod retrieveMethod(String methodName, Class[] arguments) {
151 return delegate.retrieveMethod(methodName, arguments);
152 }
153
154
155
156 public MetaMethod retrieveStaticMethod(String methodName, Class[] arguments) {
157 return delegate.retrieveStaticMethod(methodName, arguments);
158 }
159
160
161
162 public void setAttribute(Object object, String attribute, Object newValue) {
163 delegate.setAttribute(object, attribute, newValue);
164 }
165
166
167
168 public void setProperties(Object bean, Map map) {
169 delegate.setProperties(bean, map);
170 }
171
172
173
174 public void setProperty(Object object, String property, Object newValue) {
175 delegate.setProperty(object, property, newValue);
176 }
177
178
179
180 public boolean equals(Object obj) {
181 return delegate.equals(obj);
182 }
183
184
185
186 public int hashCode() {
187 return delegate.hashCode();
188 }
189
190
191
192 public String toString() {
193 return delegate.toString();
194 }
195 }