Community
Participate
Working Groups
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
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