Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.java.beans.decoder
Class MethodFinder  view MethodFinder download MethodFinder.java

java.lang.Object
  extended bygnu.java.beans.decoder.MethodFinder

class MethodFinder
extends java.lang.Object


Field Summary
private static java.util.HashMap typeMapping
          Provides a mapping between a wrapper class and its corresponding primitive's type.
 
Constructor Summary
private MethodFinder()
           
 
Method Summary
private static java.lang.Class[] getArgumentTypes(java.lang.Object[] arguments)
          Transforms an array of argument objects into an array of argument types.
(package private) static java.lang.reflect.Constructor getConstructor(java.lang.Class klass, java.lang.Object[] arguments)
           
(package private) static java.lang.reflect.Method getMethod(java.lang.Class klass, java.lang.String name, java.lang.Object[] arguments)
          Searches a Method which can accept the given arguments.
private static boolean matchingArgumentTypes(java.lang.Class[] methodArgTypes, java.lang.Class[] suppliedArgTypes)
          Tests whether the argument types supplied to the method argument types are assignable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

typeMapping

private static java.util.HashMap typeMapping
Provides a mapping between a wrapper class and its corresponding primitive's type.

Constructor Detail

MethodFinder

private MethodFinder()
Method Detail

getMethod

static java.lang.reflect.Method getMethod(java.lang.Class klass,
                                          java.lang.String name,
                                          java.lang.Object[] arguments)
                                   throws java.lang.NoSuchMethodException
Searches a Method which can accept the given arguments.


getConstructor

static java.lang.reflect.Constructor getConstructor(java.lang.Class klass,
                                                    java.lang.Object[] arguments)
                                             throws java.lang.NoSuchMethodException

getArgumentTypes

private static java.lang.Class[] getArgumentTypes(java.lang.Object[] arguments)
Transforms an array of argument objects into an array of argument types. For each argument being null the argument is null, too. An argument type being null means: Accepts everything (although this can be ambigous).


matchingArgumentTypes

private static boolean matchingArgumentTypes(java.lang.Class[] methodArgTypes,
                                             java.lang.Class[] suppliedArgTypes)
Tests whether the argument types supplied to the method argument types are assignable. In addition to the assignment specifications this method handles the primitive's wrapper classes as if they were of their primitive type (e.g Boolean.class equals Boolean.TYPE). When a supplied argument type is null it is assumed that no argument object was supplied for it and the test for this particular parameter will pass.