Here you can find the source of getSetter(Class> clazz, String property, Class> type)
private static Method getSetter(Class<?> clazz, String property, Class<?> type)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; public class Main { private static Method getSetter(Class<?> clazz, String property, Class<?> type) { String setterName = "set" + property.substring(0, 1).toUpperCase() + property.substring(1); try {//from ww w . jav a2 s.c o m Method method = clazz.getDeclaredMethod(setterName, type); return method; } catch (NoSuchMethodException e) { throw new IllegalArgumentException("no setter found for property '" + property + "'", e); } } }