Here you can find the source of getGettersMethods(Object object)
public static List<Method> getGettersMethods(Object object)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; public class Main { public static List<Method> getGettersMethods(Object object) { List<Method> getters = new ArrayList<>(); Method[] methods = object.getClass().getMethods(); for (Method method : methods) { String methodName = method.getName(); if ((methodName.startsWith("get") || methodName.startsWith("is")) && !methodName.equals("getClass")) { getters.add(method);//from ww w.j a v a 2 s . c o m } } return getters; } }