获取类访问器方法
/** from n o w j a v a . c o m**/ import java.lang.reflect.Method; public class Main{ public static void main(String[] argv) throws Exception{ Class clazz = String.class; String propertyName = "nowjava.com"; System.out.println(getAccessor(clazz,propertyName)); } public static final String[] ACCESSOR_PREFIXES = new String[] { "is", "get", "has" }; public static Method getAccessor(Class clazz, String propertyName) { propertyName = StringHelper.capitalize(propertyName); for (String prefix : ACCESSOR_PREFIXES) {//来自 nowjava.com - 时代Java try { return clazz.getMethod(prefix + p