Here you can find the source of getGetters(Object bean)
public static List getGetters(Object bean)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.*; import java.util.regex.Pattern; public class Main { private static final Pattern PTN_GETTER = Pattern.compile("(get|is)[A-Z0-9].+"); public static List getGetters(Object bean) { ArrayList list = new ArrayList(); Method[] methods = bean.getClass().getMethods(); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (PTN_GETTER.matcher(method.getName()).matches() && !"getClass".equals(method.getName()) && method.getParameterTypes().length == 0 && Modifier.isPublic(method.getModifiers()) && !Modifier.isStatic(method.getModifiers())) list.add(method);/* ww w . ja va2 s . c o m*/ } return list; } }