Here you can find the source of getSetters(Object obj)
public static List<Method> getSetters(Object obj)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.*; import java.util.*; public class Main { public static List<Method> getSetters(Object obj) { List<Method> ret = new ArrayList<Method>(); for (Method method : obj.getClass().getMethods()) { int mod = method.getModifiers(); if (Modifier.isStatic(mod) || !Modifier.isPublic(mod)) continue; if (method.getParameterTypes().length != 1 || method.getReturnType() != Void.TYPE) continue; String name = method.getName(); if (!name.startsWith("set")) continue; ret.add(method);//from w w w . j a v a 2 s . c o m } return ret; } }