Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] How to specify anonymous inner class directly?

Hello all,
I can specify anonymous inner class like this:

public class Test{
Runnable r = new Runnable(){
public void run(){}
};
}

public aspect TestAspect{
after():
execution(Test.*1.new(..))
&& if(thisJoinPoint.getThis().getClass().getName().equals("Test$1"))
{
System.out.println(
thisJoinPoint.getThis().getClass().getName() + " created!");
}
}

But I want to specify directly(like "Test.1.new(..)", with no run-time
condition).
any ideas?

Thanks in advance
takao.




Back to the top