Announcement Announcement Module
Collapse
No announcement yet.
Class and/or Method annotation match Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Class and/or Method annotation match

    Hi!

    I want to create an @Around pointcut, what's match to MyAnnotation. Because MyAnnotation can place in method or type level. And I want to match.

    I want to call my custom method if MyAnnotation present the executing method or the executing method class level. (The method level override the class level annotation values)

    Any ide how can I do that?


    Cow

  • #2
    Originally posted by b0c1 View Post
    Hi!

    I want to create an @Around pointcut, what's match to MyAnnotation. Because MyAnnotation can place in method or type level. And I want to match.

    I want to call my custom method if MyAnnotation present the executing method or the executing method class level. (The method level override the class level annotation values)

    Any ide how can I do that?


    Cow
    Can you rephrase the question?

    Comment


    • #3
      I think he wants this:

      Code:
      @SomeAnnotation
      class Whatever {
          ...
      
          @SomeOtherAnnotation
          public void someMethod() {
          ...
          }
      
          ....
      }
      So he wants to match all methods in Whatever class except ones that have different annotation than then the class annotation. so pointcut annotation(SomeAnnotation.class) picks up everything but someMethod(). afaik, can't be done, you have to annotate each method but I haven't tested this....

      Comment

      Working...
      X