获取方法签名
/** * BSD-style license; for more info see http://pmd.sourceforge.net/license.html */ //package com.nowjava; public class Main { /* NowJava.com */ public static final String CLINIT = "<clinit>"; public static final String INIT = "<init>"; public static String getMethodSignature(String name, Class... parameterTypes) { StringBuilder builder = new StringBuilder(); builder.append(name); if (!(name.equals(CLINIT) || name.equals(INIT))) { /** from * nowjava **/ builder.append("("); if (parameterTypes != null) { for (int i = 0; i < parameterTypes.length; i++) { if (i > 0) { builder.append(", ");