Here you can find the source of getGetters(Class c)
public static List<Method> getGetters(Class c)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; public class Main { public static List<Method> getGetters(Class c) { List<Method> list = new ArrayList<Method>(); Method[] methods = c.getMethods(); for (int i = 0; i < methods.length; i++) { String name = methods[i].getName(); if (!name.startsWith("get") || name.equals("getClass") || name.equals("getInstance") || methods[i].getParameterTypes().length != 0) { continue; }/*from w w w.java2s .c o m*/ list.add(methods[i]); } return list; } }