home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Software für Mac-OS X / Entwickler-Tools / netbeans / modules / ext / djava.jar / koala / dynamicjava / classinfo / JavaMethodInfo.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-03-14  |  1.5 KB  |  56 lines

  1. package koala.dynamicjava.classinfo;
  2.  
  3. import java.lang.reflect.Method;
  4.  
  5. public class JavaMethodInfo implements MethodInfo {
  6.    private Method javaMethod;
  7.    private ClassInfo[] parameters;
  8.    private ClassInfo[] exceptions;
  9.  
  10.    public int getModifiers() {
  11.       return this.javaMethod.getModifiers();
  12.    }
  13.  
  14.    public ClassInfo getReturnType() {
  15.       return new JavaClassInfo(this.javaMethod.getReturnType());
  16.    }
  17.  
  18.    public String getName() {
  19.       return this.javaMethod.getName();
  20.    }
  21.  
  22.    public ClassInfo[] getParameterTypes() {
  23.       if (this.parameters == null) {
  24.          Class[] var1 = this.javaMethod.getParameterTypes();
  25.          this.parameters = new ClassInfo[var1.length];
  26.  
  27.          for(int var2 = 0; var2 < var1.length; ++var2) {
  28.             this.parameters[var2] = new JavaClassInfo(var1[var2]);
  29.          }
  30.       }
  31.  
  32.       return (ClassInfo[])this.parameters.clone();
  33.    }
  34.  
  35.    public ClassInfo[] getExceptionTypes() {
  36.       if (this.exceptions == null) {
  37.          Class[] var1 = this.javaMethod.getExceptionTypes();
  38.          this.exceptions = new ClassInfo[var1.length];
  39.  
  40.          for(int var2 = 0; var2 < var1.length; ++var2) {
  41.             this.exceptions[var2] = new JavaClassInfo(var1[var2]);
  42.          }
  43.       }
  44.  
  45.       return (ClassInfo[])this.exceptions.clone();
  46.    }
  47.  
  48.    public boolean equals(Object var1) {
  49.       return var1 != null && var1 instanceof JavaMethodInfo ? this.javaMethod.equals(((JavaMethodInfo)var1).javaMethod) : false;
  50.    }
  51.  
  52.    public JavaMethodInfo(Method var1) {
  53.       this.javaMethod = var1;
  54.    }
  55. }
  56.