Added a version of findMethod() that takes the arguments themselves rather
than the types of the arguments. git-svn-id: https://samskivert.googlecode.com/svn/trunk@339 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: MethodFinder.java,v 1.3 2001/10/03 02:22:58 mdb Exp $
|
// $Id: MethodFinder.java,v 1.4 2001/10/03 03:05:09 mdb Exp $
|
||||||
//
|
//
|
||||||
// samskivert library - useful routines for java programs
|
// samskivert library - useful routines for java programs
|
||||||
// Copyright (C) 2001 Michael Bayne
|
// Copyright (C) 2001 Michael Bayne
|
||||||
@@ -156,6 +156,18 @@ public class MethodFinder
|
|||||||
return (Method) findMemberIn(methodList, parameterTypes);
|
return (Method) findMemberIn(methodList, parameterTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Like {@link #findMethod(String,Class[])} except that it takes the
|
||||||
|
* actual arguments that will be passed to the found method and
|
||||||
|
* creates the array of class objects for you using {@link
|
||||||
|
* ClassUtil#getParameterTypesFrom}.
|
||||||
|
*/
|
||||||
|
public Method findMethod (String methodName, Object[] args)
|
||||||
|
throws NoSuchMethodException
|
||||||
|
{
|
||||||
|
return findMethod(methodName, ClassUtil.getParameterTypesFrom(args));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basis of {@link #findConstructor} and {@link #findMethod}. The
|
* Basis of {@link #findConstructor} and {@link #findMethod}. The
|
||||||
* member list fed to this method will be either all {@link
|
* member list fed to this method will be either all {@link
|
||||||
|
|||||||
Reference in New Issue
Block a user