Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Accessing private members from advice

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

You can use privileged aspects to access private members.
http://www.eclipse.org/aspectj/doc/released/progguide/semantics-aspects.html#aspect-privilege

 - Gijs Peek

Cosmin Mogos wrote:
> Hi,
>
> Is it possible to access private members of class from an advice
> that is in another package?
>
> I have a class in package a and I want to create an aspect in
> package a.test that adds a getState function to the class in package
> a. For that I wold need access to some private/protected members
> that I wold not like to make public (or add getters).
>
> This aspect wold be used only for testing purposes so I don't want
> to put it in package a to get access to protected members.
>
> Thanks,
> Cosmin Mogos
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBSASLgbb66fbjXztVAQIFpBAAoeDPEvLpM/v7VuN9DWTcPrBAsCqAfk1a
lkesUrvBkUpRF4iq7gK5EnbuqQ6VmDu1PW9IlNcd6A9nfHJwDFUuWHm3d6P6jFHe
PiDvHr55t3xFLSM4yGjPSNNjWLHTJ43Miq/ZehG+59/97SC8GeOxGzjbEUfv+gSX
RJ3s7xp4Blbzt4Npc6bnXzclk+K4y1csVp9nBa8lchCCGKD/TManmjJILTjVBBsh
/RSbSJeQLVQk1KrSXN4iXdF/MrJYQ+y/Fpqo6233qucbT55DCP3KYg6oLlHWHUh1
aCoerFfmOio2dD75WWH5QUclVAVDojakr8s3Ref8kb+8c/kPUtb3gkAQLTaF4t1l
uteOa/f93dEhsbpK3cmdueVOwwJ7NXLuDbmH+MCx1DLBA/JF1r1dc9hoQRWiKrnH
jwT5pzaTA/esjNrR7qe45GW04qhnsKAFQZzreLVLr7vZPQmA1UtsBNY/rFT2EA9R
SB+YrV2qVUDiiF39XjsIvOYUJp/IUf4hZOEEbkY/OBJ60vXtngdLw7zjndQqS8ap
7SkaK7hr/jRA9oAGDoE8TPEXVp+aotwJy+wWIJ6ZzG3ny4/AOr0pXpdvmUQkmkFj
5HvK24gxF8z0aTQzJfbxZ8nAmfWeALPrwKvVD+Yq3aKcbcWw50RjH7Qh2CMlZZZj
L3AzoxXs90c=
=F9A5
-----END PGP SIGNATURE-----



Back to the top