解析二传手
/**时 代 J a v a - N o w J a v a . c o m**/ //package com.nowjava; import java.lang.reflect.Method; public class Main { private static final String SET_PREFIX = "set"; public static Method parseSetter(Object bean, String propertyName, Class<?> propertyClass) throws SecurityException, NoSuchMethodException { return bean.getClass().getMethod( getSetMethodName(propertyName, propertyClass)); }//N o w J a v a . c o m 提 供 public static String getSetMethodName(String propertyName, Class<?> propertyClass) { return SET_PREFIX + capitalizeMethodName(propertyName); } private static String capitalizeMethodName(String propertyName) { StringBuilder sb =