This is really a Java reflection API question. Check
http://java.sun.com/javase/6/docs/api/java/lang/reflect/AccessibleObject.html#setAccessible(boolean)to
access non-public members. Also, if you go that route, you don't need
your aspect to be marked at privileged.

-Ramnivas

On Wed, Dec 2, 2009 at 6:40 PM, ivlev jenia <[email protected]> wrote:

> Hello.
> From a privileged AspectJ class I want to access the private fields of an
> object; lets call this object x.
> To do this I would do x.fieldname.
> Now I have fieldname stored in a String, lets call it y.
> So how can I do the equivalent of x.y ?
> Also I tried to go x.getClass().getField(y). This works fine for public
> fields, I need to do it for private fields.
>
> Thank you for your kind concner.
> Jenia Ivlev
>
> ------------------------------
> The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo!
> *Get it Now for Free!* <http://downloads.yahoo.com/ca/internetexplorer/>
>
> _______________________________________________
> aspectj-users mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
_______________________________________________
aspectj-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to