commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitri Plotnikov <>
Subject [reflect] Method lookup
Date Sun, 16 Jun 2002 23:39:12 GMT
Here's something that might belong in reflect.  Check out this class:

I know, I know, it could benefit from a lot more javadoc and I will add it

The basic idea of MethodLookupUtils is that it performs dynamically the type
of method lookup that a Java compiler does statically.

For example, let's say I have this class:

    class Foo {
      void bar(int x);
      void bar(String y);


    Method method = MethodLookupUtils.lookupMethod(Foo.class, "bar", new

will perform a method lookup based on the class, method name, argument types
and, if there is no exact type match, on _convertability_ of the arguments
to the parameter types.

MethodLookupUtils are used by JXPath to choose among extension functions.

Just another drop in the pool of ideas.

- Dmitri

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message