Here you can find the source of getSetterForGetter(Method[] methods, Method getter)
public static Method getSetterForGetter(Method[] methods, Method getter)
//package com.java2s; /*//w ww. j a v a2 s . co m * $Id$ * * Copyright 2006 University of Dundee. All rights reserved. * Use is subject to license terms supplied in LICENSE.txt */ import java.lang.reflect.Method; public class Main { public static Method getSetterForGetter(Method[] methods, Method getter) { for (int i = 0; i < methods.length; i++) { Method method = methods[i]; if (method.getName().startsWith("set")) { if (method.getName().substring(1).equals(getter.getName().substring(1))) { return method; } } } return null; } }