1 package test; 2 3 import alt.jiapi.reflect.*; 4 5 8 public class BasicMethodTest { 9 public static void main(String args[]) throws Exception { 10 Loader loader = new Loader(); 11 JiapiClass clazz = loader.loadClass("java.lang.Object"); 12 JiapiMethod []methods = clazz.getMethods(); 14 15 for (int i = 0; i < methods.length; i++) { 16 JiapiMethod method = methods[i]; 17 System.out.println(clazz.getName() + "." + method.getName()); 18 19 String []paramNames = method.getParameterTypeNames(); 20 for (int j = 0; j < paramNames.length; j++) { 21 System.out.println("\tP: " + paramNames[j]); 22 } 23 24 String []exceptionNames = method.getExceptionNames(); 25 for (int j = 0; j < exceptionNames.length; j++) { 26 System.out.println("\tE: " + exceptionNames[j]); 27 } 28 } 29 } 30 } 31 | Popular Tags |