Lighter Joul wrote:
Hi, i'm a newbie in bcel. recently i have to develop an tool, something like
aop weaver. i want to acquire the method's parameters. such as:
m1(int i, String j, Object o )
{
......
m1_org( i, j, o ); //created by bcel
......
}
m1_org(int i, String j, Object o)
{
......
}
that is, in m1() method, i want to create a method invoking m1_org(), and
the parameters are the same with m1().
i have read a lot about bcel docs, and know how to invoke m1_org() method,
but the problem is, i don't know how to acquire and confirm the parameters.
i think of localvariabletable, however, i don't know how to do it excatly.
can anyone give me some suggestions. any help will be appreciated. looking
forwards your kindly reply!
As far as i understand method parameters are always found in a fixed
location in the local variable array. With instance methods local
variable 0 contains the this-pointer and method parameters start from
index 1.
You can find out the method parameters either from the method's
LocalVariableTable or using the through the argument types array
(method.getArgumentTypes()). The LocalVariableTable can include also
non-argument local variables so you'll have to filter those out with
LocalVariable.getStartPC().
t. marko
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]