Here you can find the source of getGetterFromCache(Class clazz)
public static List<Method> getGetterFromCache(Class clazz)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; public class Main { private static final Map<Class, List<Method>> getterCache = new ConcurrentHashMap<>(); public static List<Method> getGetterFromCache(Class clazz) { List<Method> methods = getterCache.get(clazz); if (methods == null) { methods = new ArrayList<>(); for (Method method : clazz.getDeclaredMethods()) { String name = method.getName(); if (method.getParameterTypes().length == 0) { if (name.startsWith("get")) { methods.add(method); }/*w w w. j a v a2 s . c o m*/ if (name.startsWith("is")) { methods.add(method); } } } getterCache.put(clazz, methods); } return methods; } }