Results 1 to 3 of 3

Thread: Class and/or Method annotation match

  1. #1
    Join Date
    Feb 2007
    Posts
    14

    Default 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. #2

    Default

    Quote 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?

  3. #3
    Join Date
    Nov 2007
    Posts
    420

    Default

    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....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •