Thanks again,
What i mean by my pattern (refering to your code example), is that i need to
set the name of myPrivateLabel to "JLabel_myPrivateLabel". I was not able to
do that since our code sometimes looks like this:
class A {
private JLabel myPrivateLabel = new JLabel();
private JLabel anotherPrivateLabel;
A() {
anotherPrivateLabel = new JLabel();
}
//methods
}
I need to be able to handle both cases and dont really understand how.
BTW - i am using annotations to define my aspects.
Thanks for you patience.
Elad.
On Mon, Apr 27, 2009 at 9:57 AM, Jochen Wuttke <[email protected]> wrote:
>
> On Apr 27, 2009, at 7:08 AM, Elad Sofer wrote:
>
> Thanks for the reply,
>>
>> The thing is that a join point after the Ctor is not suffiecient since i
>> need to have the following name pattern <Type>_<MemberName>, this means that
>> if i have a JLabel within class A and it is initialized in the declerative
>> part i do not have access to the instance of A that holds the JLabel, and
>> this is needed to be able to match the member name using reflection (or is
>> it not ?).
>>
>
> I'm still not sure what you mean when you say <Type>_<MemberName>. Is it
> something like this;
>
> class A {
>
> private JLabel myPrivateLabel;
>
> A() {
>
> myPrivateLabel = new JLabel();
> }
>
> //methods
>
> }
>
> If it is, then I assume you want to set the name in the JLabel to
> "A_myPrivateLabel"?
> If that's the case you can change the "execution" join-point to "call",
> that at least gives you access to the current instance of "A". Catching the
> member name requires an additional bit of advice at every field assignment
> where you can check the type and remember the name if necessary.
>
> If all this is not what you meant, I think you should give a code example.
>
>
> Jochen
>
> _______________________________________________
> 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