0
votes

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("execution(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

1
Write some code. If it doesn't work, post it here, along with the error messages. Don't ask for free code without putting in some effort of your own. - Sean Patrick Floyd
Also: are you using @AspectJ-style Spring AOP or real aspectj (with aspectj compiler) - Sean Patrick Floyd

1 Answers

2
votes

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

You can find a cheat sheet here.