1 package xdoclet.beans;
2
3 import java.beans.MethodDescriptor;
4
5 /***
6 * This class represents a conmbination of a method, arguments and an object,
7 * making it easy to invoke a method using reflecion.
8 *
9 * @author <a href="mailto:aslak.hellesoy at bekk.no">Aslak Hellesøy</a>
10 * @version $Revision: 1.2 $
11 */
12 public class Invocation {
13 private MethodDescriptor _methodDescriptor;
14 private Object _bean;
15 private Object[] _args;
16
17 public Invocation(MethodDescriptor methodDescriptor, Object bean, Object[] args) {
18 _methodDescriptor = methodDescriptor;
19 _bean = bean;
20 _args = args;
21 }
22
23 public Object invoke() throws Exception {
24 return _methodDescriptor.getMethod().invoke(_bean, _args);
25 }
26
27 // TODO remove this
28 public String toString() {
29 return (String) _args[0];
30 }
31 }
This page was automatically generated by Maven