commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Néstor Boscán <nestor.bos...@tcs.com.ve>
Subject RE: MethodUtils.invokeMethod on a static method
Date Sat, 12 Mar 2005 12:26:47 GMT
Hi but in the case of the java.lang.reflect.Method.invoke it knows which
class and which method to invoke. In MethodUtils.invokeMethod the only way
to know which class to call is to pass the object.

Regards,

Néstor Boscán 

-----Mensaje original-----
De: Simon Kitching [mailto:skitching@apache.org] 
Enviado el: Saturday, March 12, 2005 1:33 AM
Para: Jakarta Commons Users List
Asunto: Re: MethodUtils.invokeMethod on a static method

On Fri, 2005-03-11 at 23:17 -0400, Néstor Boscán wrote:
> Hi
>  
> I would like to use MethodUtils.invokeMethod to call a static method 
> but it always ask for an object. Is there a way to call a static member?

I believe it works the same as java.lang.reflect.Method.invoke, ie the first
parameter ("object") is ignored if the method is static; so just pass null
as the object.

Regards,

Simon



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message