Would you please to show me a complete example ???

Eric

----- Original Message ----- 
From: "Yasir Siraj" <[EMAIL PROTECTED]>
To: "BCEL Users List" <[EMAIL PROTECTED]>; "Eric Chow"
<[EMAIL PROTECTED]>
Sent: Wednesday, June 30, 2004 3:56 PM
Subject: Re: Retrieve all the values of variables in the class ?


> Hello,
>    To get all class variables & their values, u can
> use this
> Field fields[] = jClass.getFields();
> for (int i = 0; i < fields.length; i++) {
>             fields[i].getName();
>             fields[i].getConstantValue();
>         }
>
> For method variables, u can use
> MethodGen mGen = new MethodGen(method,
> className,constantpoolgen );
> mGen.getLocalVariables();
>
> I hope this will help.
>
> Regards.
> Yasir Siraj.
> IMP-DCS
> Chalmers University Of Technology
> Goteborg, Sweden.
>
> --- Eric Chow <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > How can I get the all variable values in the class
> > including all the globale
> > constant values and local variable values ??
> >
> > For example,
> >
> > public class A {
> >    private static final String s = "Hello World";
> >
> >    public int sum(int a, in b) {
> >       int x = 100;
> >       return a + b + x;
> >    }
> > }
> >
> >
> > How can I get the value of "x" in the method sum and
> > the value of String s
> > ???
> >
> >
> > Eric
> >
> >
> > ==========================
> > If you know what you are doing,
> > it is not called RESEARCH!
> > ==========================
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to