commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [reflect] Method lookup
Date Mon, 17 Jun 2002 00:26:17 GMT
I haven't looked at it (yet) but it is one method that I would consider to
be high on the list for inclusion

Stephen

----- Original Message -----
From: "Dmitri Plotnikov" <dmitri@apache.org>
To: "Jakarta Commons Developers" <commons-dev@jakarta.apache.org>
Sent: Monday, June 17, 2002 12:39 AM
Subject: [reflect] Method lookup


> Here's something that might belong in reflect.  Check out this class:
>
>
http://jakarta.apache.org/commons/jxpath/xref/org/apache/commons/jxpath/util
> /MethodLookupUtils.html
>
> I know, I know, it could benefit from a lot more javadoc and I will add it
> soon.
>
> 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);
>     }
>
> Then,
>
>     Method method = MethodLookupUtils.lookupMethod(Foo.class, "bar", new
> Integer(3));
>
> 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:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message