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, Oct 31, 2008 at 5:46 AM, Piers Powlesland <
[EMAIL PROTECTED]> wrote:
> 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;
> }
>
> }
>
> aspect TestAspect{
> public int x;
> }
>
>
> 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.
>
> Thank you for your help
>
> Piers
> _______________________________________________
> 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