Announcement Announcement Module
Collapse
No announcement yet.
checking annotation properties at run time Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • checking annotation properties at run time

    I have created an annotation which goes like the one below.
    Code:
    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.METHOD)
    public @interface AnAnnotation{
    	public String value();
    }
    as is there a way with which i can do an equivalent of this ?
    Code:
    execution(@AnAnnotation(value=="somethingInteresting") *.*(..))

  • #2
    In the README for 1.6.0:

    http://www.eclipse.org/aspectj/doc/r...EADME-160.html

    This concept is described, it is called annotation value matching. However it is not yet implemented for all variations of annotation value kinds. As the example in the README shows, it works for enums so far. Please raise an enhancement request against AspectJ for string value matching:

    https://bugs.eclipse.org/bugs/enter_...roduct=AspectJ

    The best you can do right now is checking it at the top of your advice after binding the annotation.

    Andy Clement
    AspectJ Project Lead
    SpringSource

    Comment

    Working...
    X