1 22 package org.jboss.util; 23 24 import java.lang.reflect.Method ; 25 26 33 public class NoSuchMethodException 34 extends java.lang.NoSuchMethodException 35 { 36 42 public NoSuchMethodException(String msg) { 43 super(msg); 44 } 45 46 52 public NoSuchMethodException(Method method) { 53 super(format(method)); 54 } 55 56 63 public NoSuchMethodException(String msg, Method method) { 64 super(msg + format(method)); 65 } 66 67 70 public NoSuchMethodException() { 71 super(); 72 } 73 74 77 public static String format(Method method) 78 { 79 StringBuffer buffer = new StringBuffer (); 80 buffer.append(method.getName()).append("("); 81 Class [] paramTypes = method.getParameterTypes(); 82 for (int count = 0; count < paramTypes.length; count++) { 83 if (count > 0) { 84 buffer.append(","); 85 } 86 buffer. 87 append(paramTypes[count].getName().substring(paramTypes[count].getName().lastIndexOf(".")+1)); 88 } 89 buffer.append(")"); 90 91 return buffer.toString(); 92 } 93 } 94 | Popular Tags |