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