|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
aspect instantiationIs there a way for getting the values of an aspect instance from another aspect?
I don't know how to do it without using static modifier in the attribute To fix it I think that I'd have to intercept aspect instantiation and get the attribute..... the aspect below contains the attribute ro be read (selectionListener). public abstract aspect AbstractListener pertarget( getListener(SelectionListener)) { private SelectionListener selectionListener = null; public abstract pointcut getListener(SelectionListener sl); before(SelectionListener sl) : getListener(sl) { this.selectionListener = sl; } public SelectionListener getSelectionListener() { return selectionListener; } } _______________________________________________ aspectj-users mailing list aspectj-users@... https://dev.eclipse.org/mailman/listinfo/aspectj-users |
|
|
Re: aspect instantiationHi João Paulo,
What you are looking for is probably the "aspectOf" method. With it you can obtain the aspect instace on which you can call the getter. I can't remember how it works wirh pertarget ... try googling it. Hope this helps, Simone Il giorno 19/giu/2009, alle ore 18.31, João Paulo Sabino de Moraes <jonamep@... m> ha scritto: > Is there a way for getting the values of an aspect instance from > another aspect? > I don't know how to do it without using static modifier in the > attribute > To fix it I think that I'd have to intercept aspect instantiation > and get the attribute..... > the aspect below contains the attribute ro be read > (selectionListener). > > > public abstract aspect AbstractListener pertarget( getListener > (SelectionListener)) { > > private SelectionListener selectionListener = null; > > public abstract pointcut getListener(SelectionListener sl); > > > > before(SelectionListener sl) : getListener(sl) { > this.selectionListener = sl; > } > > > public SelectionListener getSelectionListener() { > return selectionListener; > } > > > } > > _______________________________________________ > aspectj-users mailing list > aspectj-users@... > https://dev.eclipse.org/mailman/listinfo/aspectj-users aspectj-users mailing list aspectj-users@... https://dev.eclipse.org/mailman/listinfo/aspectj-users |
|
|
Re: aspect instantiationThanks for replying Simone, now I know what to look for =)
_______________________________________________ aspectj-users mailing list aspectj-users@... https://dev.eclipse.org/mailman/listinfo/aspectj-users |
| Free embeddable forum powered by Nabble | Forum Help |