Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] How can you access an aspect from a normal java class

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


Back to the top