I\'ve configureg AspectJ with Spring and it works fine when \"catching\" public methods called from out of the class. Now I want do something like this:
publ
Yes it is easy to catch private methods with AspectJ.
An example that prints a sentence before all private methods:
@Pointcut("execution(private * *(..))")
public void anyPrivateMethod() {}
@Before("anyPrivateMethod()")
public void beforePrivateMethod(JoinPoint jp) {
System.out.println("Before a private method...");
}
If you are familiar with Eclipse, I recommend to develop AspectJ with STS or only install the AJDT plugin.
More information about Spring AOP capabilities can be found in the Spring reference documentation here.