Two questions about AspectJ possibilities before I dive in [message #542728] |
Fri, 25 June 2010 13:47  |
Eclipse User |
|
|
|
Hello all,
I am currently in the process of getting Equinox Aspects going for my OSGI based project. Please see the Equinox forums here if you know your way around Equinox Aspects. Before I try to implement some things I believe AspectJ can do, I'd like to know if my plans are sane.
1) In a single class, if I have at least one specific @AspectJ annotation present with a certain prefix on its name, can I then trigger adding a certain block of code?
2) In a single class, if I have at least one specific @AspectJ annotation present with a certain prefix on its name, can I enforce that a certain interface for this class must be implemented?
Also, am I in the right board for these questions? I didn't see a general AspectJ forums.
|
|
|
|
|
|
Re: Two questions about AspectJ possibilities before I dive in [message #601060 is a reply to message #542728] |
Fri, 25 June 2010 16:44  |
Eclipse User |
|
|
|
There is an aspectj mailing list where these kinds of questions are asked and answered on a regular basis. See: http://eclipse.org/aspectj
I think that you have phrased both of these questions a bit wrongly.
1) In a single class, if I have at least one specific @AspectJ annotation present with a certain prefix on its name, can I then trigger adding a certain block of code?
There are many annotations that are specific to aspectj. The only ones that will trigger adding a block of code are the advice annotations (eg- @before, @around, and @after*). You also need the @Aspect annotation present on the class declaration so that the weaver knows to treat that class as an aspect.
I don't know what you mean by prefix. That shouldn't have anything to do with things.
2) In a single class, if I have at least one specific @AspectJ annotation present with a certain prefix on its name, can I enforce that a certain interface for this class must be implemented?
Since I'm not really sure what you are trying to do, a code sample from you would help.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03702 seconds