KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > javax > management > compliance > signature > support > ObjectMethod


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package test.javax.management.compliance.signature.support;
10
11 /**
12  * @version $Revision: 1.4 $
13  */

14 public interface ObjectMethod
15 {
16    public int getModifiers();
17
18    public Class JavaDoc getReturnType();
19
20    public String JavaDoc getName();
21
22    public Class JavaDoc[] getParameterTypes();
23
24    public Class JavaDoc[] getExceptionTypes();
25
26    public static class Constructor implements ObjectMethod
27    {
28       private java.lang.reflect.Constructor JavaDoc constructor;
29
30       public Constructor(java.lang.reflect.Constructor JavaDoc ctor)
31       {
32          this.constructor = ctor;
33       }
34
35       public int getModifiers()
36       {
37          return constructor.getModifiers();
38       }
39
40       public Class JavaDoc getReturnType()
41       {
42          return constructor.getDeclaringClass();
43       }
44
45       public String JavaDoc getName()
46       {
47          return constructor.getName();
48       }
49
50       public Class JavaDoc[] getParameterTypes()
51       {
52          return constructor.getParameterTypes();
53       }
54
55       public Class JavaDoc[] getExceptionTypes()
56       {
57          return constructor.getExceptionTypes();
58       }
59    }
60
61    public static class Method implements ObjectMethod
62    {
63       private java.lang.reflect.Method JavaDoc method;
64
65       public Method(java.lang.reflect.Method JavaDoc method)
66       {
67          this.method = method;
68       }
69
70       public int getModifiers()
71       {
72          return method.getModifiers();
73       }
74
75       public Class JavaDoc getReturnType()
76       {
77          return method.getReturnType();
78       }
79
80       public String JavaDoc getName()
81       {
82          return method.getName();
83       }
84
85       public Class JavaDoc[] getParameterTypes()
86       {
87          return method.getParameterTypes();
88       }
89
90       public Class JavaDoc[] getExceptionTypes()
91       {
92          return method.getExceptionTypes();
93       }
94    }
95 }
96
Popular Tags