home *** CD-ROM | disk | FTP | other *** search
- package koala.dynamicjava.classinfo;
-
- import java.lang.reflect.Method;
-
- public class JavaMethodInfo implements MethodInfo {
- private Method javaMethod;
- private ClassInfo[] parameters;
- private ClassInfo[] exceptions;
-
- public int getModifiers() {
- return this.javaMethod.getModifiers();
- }
-
- public ClassInfo getReturnType() {
- return new JavaClassInfo(this.javaMethod.getReturnType());
- }
-
- public String getName() {
- return this.javaMethod.getName();
- }
-
- public ClassInfo[] getParameterTypes() {
- if (this.parameters == null) {
- Class[] var1 = this.javaMethod.getParameterTypes();
- this.parameters = new ClassInfo[var1.length];
-
- for(int var2 = 0; var2 < var1.length; ++var2) {
- this.parameters[var2] = new JavaClassInfo(var1[var2]);
- }
- }
-
- return (ClassInfo[])this.parameters.clone();
- }
-
- public ClassInfo[] getExceptionTypes() {
- if (this.exceptions == null) {
- Class[] var1 = this.javaMethod.getExceptionTypes();
- this.exceptions = new ClassInfo[var1.length];
-
- for(int var2 = 0; var2 < var1.length; ++var2) {
- this.exceptions[var2] = new JavaClassInfo(var1[var2]);
- }
- }
-
- return (ClassInfo[])this.exceptions.clone();
- }
-
- public boolean equals(Object var1) {
- return var1 != null && var1 instanceof JavaMethodInfo ? this.javaMethod.equals(((JavaMethodInfo)var1).javaMethod) : false;
- }
-
- public JavaMethodInfo(Method var1) {
- this.javaMethod = var1;
- }
- }
-