Here's an example.
public void test() {
JavaClass jClass;
ConstantPool cp;
ConstantPoolGen cpg;
jClass = new ClassParser("HelloWorld.class").parse();
cp = jClass.getConstantPool();
cpg = new ConstantPoolGen(cp);
String className = jClass.getClassName();
Method methods[] = jClass.getMethods();
Field fields[] = jClass.getFields();
for (int i = 0; i < fields.length; i++) {
System.out.println(fields[i].getName());
System.out.println(fields[i].getConstantValue);
}
for (int j = 0; j < methods.length; j++) {
MethodGen mg = new MethodGen(methods[j], className,
cpg);
LocalVariableGen vGen[] = mg.getLocalVariables();
for (int k = 0; k < vGen.length; k++) {
System.out.println(vGen[k].getName());
}
}
}
I hope now, u'll get the idea on how to do things..
Regards.
Yasir Siraj.
IMP-DCS
Chalmers University Of Technology
Goteborg, Sweden.
=====
Regards.
Yasir Siraj.
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]