开发者

Creating Pointcut annotation in Spring aspectj in Java

I am using org.aspectj.lang.annotation.Pointcut. I have an interface com.home.learn.Try.

  • I want a pointcut annotation created to watch all methods of that class that implemets the interface (com.home.learn.Try)

I used @Pointcut("exec开发者_开发百科ution(com.home.learn.Try.*(..))") but i got the error

Pointcut is not well-formed: expecting 'name pattern' at character position 34
execution(com.home.learn.Try.*(..))
  • I want a pointcut to watch(specific method) com.home.learn.Try.print(java.lang.String) method

Also I am curious about how to create pointcut annotation to watch all methods of a concrete class which extends an abstract class.

Thanks


Try execution(* com.home.learn.Try.*(..)).

You can find a cheat sheet here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜