org.mentawai.util
Class FindMethod

java.lang.Object
  extended by org.mentawai.util.FindMethod

public class FindMethod
extends java.lang.Object

Find method with polymorphism! Class.getMethod only finds an exact match.

Author:
Jon Skeet (http://groups.google.com/group/comp.lang.java.programmer/browse_thread/thread/921ab91865c8cc2e/9e141d3d62e7cb3f)

Constructor Summary
FindMethod()
           
 
Method Summary
static java.lang.reflect.Method getDeclaredMethod(java.lang.Class source, java.lang.String name, java.lang.Class[] parameterTypes)
          Finds the most specific applicable declared method
static java.lang.reflect.Method getMethod(java.lang.Class<? extends java.lang.Object> source, java.lang.String name, java.lang.Class[] parameterTypes)
          Finds the most specific applicable method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindMethod

public FindMethod()
Method Detail

getMethod

public static java.lang.reflect.Method getMethod(java.lang.Class<? extends java.lang.Object> source,
                                                 java.lang.String name,
                                                 java.lang.Class[] parameterTypes)
                                          throws java.lang.NoSuchMethodException
Finds the most specific applicable method

Parameters:
source - Class to find method in
name - Name of method to find
parameterTypes - Parameter types to search for
Throws:
java.lang.NoSuchMethodException

getDeclaredMethod

public static java.lang.reflect.Method getDeclaredMethod(java.lang.Class source,
                                                         java.lang.String name,
                                                         java.lang.Class[] parameterTypes)
                                                  throws java.lang.NoSuchMethodException
Finds the most specific applicable declared method

Parameters:
source - Class to find method in
name - Name of method to find
parameterTypes - Parameter types to search for
Throws:
java.lang.NoSuchMethodException


Copyright © 2005 Mentawai Team. All Rights Reserved.