Hi
I would like to get access to an aspect from a java class so that I
can set some of its fields.
I have tried the following form but Eclipse gives the error
"TestAspect cannot be resolved".
Class G{
public void setAspectField(){
TestAspect.aspectOf().x = 0;
The code seems right. Check your import statements and/or your Eclipse
setting (AspectJ nature, inclusion of TestAspect on source path, etc.)
You may define pointcuts in a class (just as you would do in an aspect).
Then you may refer to those pointcuts as MyClass.myPointcut().
-Ramnivas
On Fri, O
> Class G{
>
>public void setAspectField(){
>TestAspect.aspectOf().x = 0;
>}
>
> }
Try openning your Java file in an aspectj editor.
> Also is there some way to define a pointcut in an normal class and then pass
> it to an aspect to use for some predefined advice.
I've been using ITDs as a big time saver in defining common actions
that can be performed on objects. This is great in that the default
code defined in the aspect applies a majority of the time. The
problem is that in the cases where it doesn't apply, almost every time
what I want to do i
Piers Powlesland schrieb:
> I have tried the following form but Eclipse gives the error
> "TestAspect cannot be resolved".
Ramnivas Laddad schrieb:
> The code seems right. Check your import statements and/or your
> Eclipse setting (AspectJ nature, inclusion of TestAspect on source
> path, etc.)
Dave,
I had the same question a long time back, so I am pasting that discussion
(obtained from the old list archive at
http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/aspectj-home/archives/users.zip;
I couldn't find a direct link to posts in it on the Internet).
The follow ups have some id