Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] priviledged aspect

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 <jenia2009@xxxxxxxxx> 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!

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Back to the top