/** * Add a method to this class. This method is handy for implementing * methods defined by a pre-existing interface. */ public MethodInfo addMethod(Method method) { Modifiers modifiers = Modifiers.getInstance(method.getModifiers()).toAbstract(false); MethodInfo mi = addMethod(modifiers, method.getName(), MethodDesc.forMethod(method)); // exception stuff... Class[] exceptions = method.getExceptionTypes(); for (int i=0; i<exceptions.length; i++) { mi.addException(TypeDesc.forClass(exceptions[i])); } return mi; }
if (!Modifier.isFinal(modifiers) && Modifier.isPublic(modifiers)) { b = new CodeBuilder (cf.addMethod(Modifiers.PUBLIC, m.getName(), MethodDesc.forMethod(m))); addWrappedCall(cf, b, m);
/** * Create a representation of the signature which includes the method name. * This uniquely identifies the method. * * @param m method to describe */ private static String createSig(Method m) { return m.getName() + ':' + MethodDesc.forMethod(m).getDescriptor(); }
static String methodDesc(Method m, Class exceptionType) { String name = m.getDeclaringClass().getName() + '.' + m.getName(); StringBuilder b = new StringBuilder(); b.append('"'); b.append(MethodDesc.forMethod(m).toMethodSignature(name)); if (exceptionType != null) { b.append(" throws "); b.append(exceptionType.getName()); } b.append('"'); return b.toString(); }
/** * Create a representation of the signature which includes the method name. * This uniquely identifies the method. * * @param m method to describe */ private static String createSig(Method m) { return m.getName() + ':' + MethodDesc.forMethod(m).getDescriptor(); }
/** * Add a method to this class. This method is handy for implementing * methods defined by a pre-existing interface. */ public MethodInfo addMethod(Method method) { Modifiers modifiers = Modifiers.getInstance(method.getModifiers()).toAbstract(false); MethodInfo mi = addMethod(modifiers, method.getName(), MethodDesc.forMethod(method)); // exception stuff... Class[] exceptions = method.getExceptionTypes(); for (int i=0; i<exceptions.length; i++) { mi.addException(TypeDesc.forClass(exceptions[i])); } return mi; }
if (!Modifier.isFinal(modifiers) && Modifier.isPublic(modifiers)) { b = new CodeBuilder (cf.addMethod(Modifiers.PUBLIC, m.getName(), MethodDesc.forMethod(m))); addWrappedCall(cf, b, m);
if (!Modifier.isFinal(modifiers) && Modifier.isPublic(modifiers)) { b = new CodeBuilder (cf.addMethod(Modifiers.PUBLIC, m.getName(), MethodDesc.forMethod(m))); addWrappedCall(cf, b, m);
if (!Modifier.isFinal(modifiers) && Modifier.isPublic(modifiers)) { b = new CodeBuilder (cf.addMethod(Modifiers.PUBLIC, m.getName(), MethodDesc.forMethod(m))); addWrappedCall(cf, b, m);
MethodDesc desc = MethodDesc.forMethod(method); String sig = desc.toMethodSignature(name);