public static Method getSetter(Class clazz, String property) { property = ReflectionUtil.getSetter(property); for (Method meth : clazz.getMethods()) { if ((meth.getModifiers() & PUBLIC) != 0 && meth.getParameterTypes().length == 1 && property.equals(meth.getName())) { return meth; } } return null; }
public static Method getSetter(Class clazz, String property) { property = ReflectionUtil.getSetter(property); for (Method meth : clazz.getMethods()) { if ((meth.getModifiers() & PUBLIC) != 0 && meth.getParameterTypes().length == 1 && property.equals(meth.getName())) { return meth; } } return null; }
public static Method getSetter(Class clazz, String property) { property = ReflectionUtil.getSetter(property); for (Method meth : clazz.getMethods()) { if ((meth.getModifiers() & PUBLIC) != 0 && meth.getParameterTypes().length == 1 && property.equals(meth.getName())) { return meth; } } return null; }
public static Method getSetter(Class clazz, String property, Class type) { String simple = "set" + property; property = ReflectionUtil.getSetter(property); for (Method meth : clazz.getMethods()) { if ((meth.getModifiers() & PUBLIC) != 0 && meth.getParameterTypes().length == 1 && (property.equals(meth.getName()) || simple.equals(meth.getName())) && (type == null || canConvert(meth.getParameterTypes()[0], type))) { return meth; } } return null; }
public static Method getSetter(Class clazz, String property, Class type) { String simple = "set" + property; property = ReflectionUtil.getSetter(property); for (Method meth : clazz.getMethods()) { if ((meth.getModifiers() & PUBLIC) != 0 && meth.getParameterTypes().length == 1 && (property.equals(meth.getName()) || simple.equals(meth.getName())) && (type == null || canConvert(meth.getParameterTypes()[0], type))) { return meth; } } return null; }
public static Method getSetter(Class clazz, String property, Class type) { property = ReflectionUtil.getSetter(property); for (Method meth : clazz.getMethods()) { if ((meth.getModifiers() & PUBLIC) != 0 && meth.getParameterTypes().length == 1 && property.equals(meth.getName()) && (type == null || canConvert(meth.getParameterTypes()[0], type))) { return meth; } } return null; }