Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Machine > Re: Obtaining m...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 795 of 803
Post > Topic >>

Re: Obtaining methods signature

by Joshua Cranmer <Pidgeot18@[EMAIL PROTECTED] > Nov 21, 2007 at 05:44 PM

Dmitry Marienko wrote:
> 
> Hi !
>   I'm dumb on simple question. How can I get  method's signature in my 
> java program in "JVM notation" ?
> 
>  For example for class
> 
>   class A {
>      void foo(int a,int b) { ... }
>   }
> 
>  I would like to get  string .../A/foo(II)V  for method 'foo' . I 
> haven't found any appropriate methods to do it.
> 
> --dima

If you have easy access the bytecode, the program `javap' can print out 
the signature for the method (foo(II)V).

Barring that, it is pretty easy to transform a 
java.lang.reflect.Method's toString() to a JVM internal String.

-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth




 4 Posts in Topic:
Obtaining methods signature
"Dmitry Marienko&quo  2007-11-21 18:19:01 
Re: Obtaining methods signature
Joshua Cranmer <Pidgeo  2007-11-21 17:44:12 
Re: Obtaining methods signature
A Pietu Pohjalainen <p  2007-11-23 12:35:18 
Re: Obtaining methods signature
"Dmitry Marienko&quo  2007-11-23 15:07:08 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 6:18:41 CDT 2008.