Java tutorial
//package com.java2s; /** * Appcelerator Titanium Mobile * Copyright (c) 2010 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ import java.lang.reflect.Method; public class Main { public static Method getMethod(Class<?> clazz, String methodName) { for (Method method : clazz.getDeclaredMethods()) { if (method.getName().equals(methodName)) { method.setAccessible(true); return method; } } return null; } }