1 Jul 2004 09:49
Urgent , BCEL beginner questions ???
Eric Chow <echow <at> macaucabletv.com>
2004-07-01 07:49:33 GMT
2004-07-01 07:49:33 GMT
Hi,
I am going to use BCEL to do some education project.
But I have so many problems and questions if I should use BCEL or other
library.
1. retrieve all the variable names and its corresponding values (global
variables, and local variables) ?
2. can I add a method with some source expression ??
for example,
clazzGen.addMethod(" int a = 10; System.out.println(a); "); // something
like this, Javassist provides this ....
3. can I insert a statement into a specific line within a method?
for example,
public void init() {
int a = 10;
// <<<<<<< insert a statement here : a = a * a;
System.out.println(a);
}
4. can I modify a specific statement ?
for example,
public void init(int x) {
return x; //<<<<<<< modify it to: return (x * 2);
}
(Continue reading)
RSS Feed