| Summary: | Feature Request: Pointcut selector for Meta Annotation Type. | ||
|---|---|---|---|
| Product: | [Tools] AspectJ | Reporter: | Marko Umek <marko.umek> |
| Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | aclement, eclipsebugs |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
I am also very interested in this functionality. It will greatly reduce the amount of boiler plate code (declaring new pointcut definitions for every annotation that contains the meta-annotation) that needs to be added at the moment. Big +1 here to this. unsetting the target field which is currently set for something already released |
Build Identifier: For example: I'd like to select all methods which are marked by a Annotation which are itself have a been annotated by a specific (meta) annotation type. Example: I've a meta annotation like SeverityLevelAnnotation and some Annotation which are using SeverityLevelAnnotation (it's somehow a kind of annotation derivation). All methods which are marked with @Warning (see below) , @Info, ... should be selected, without explicit naming these "derived" annotations. @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Documented @SeverityLevelAnnotation(text = SeverityLevels.WARNING_TEXT, severityLevel = SeverityLevels.WARNING, filterLevel = FilterLevel.WARNING) public @interface Warning { String value() default ""; } The proposed pointcut definition could be like this: pointcut allSeverityLevels() : execution(* *.*(..)) && @annotation(SeverityLevelAnnotation+); or pointcut allSeverityLevels(SeverityLevelAnnotation+ sevrityLevel) : execution(* *.*(..)) && @annotation(sevrityLevel); Reproducible: Always