您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

DeclareAnnotMethodCtor.java 540B

123456789101112131415161718192021222324
  1. import java.lang.annotation.*;
  2. @Retention(RetentionPolicy.RUNTIME)
  3. @interface Annot {}
  4. class Person {}
  5. aspect DeclareAnnot {
  6. declare @constructor: (Person.new()) || (Person.new(*)) : @Annot;
  7. // declare @method: (* *.get*()) && (boolean *.is*()): @Annot;
  8. /*
  9. declare @field: String *.* && boolean *.* : @Annot;
  10. declare @constructor: Person.new() && Person.new(*) : @Annot;
  11. declare @method: !(* *.get*()): @Annot;
  12. declare @field: !(String *.*) : @Annot;
  13. declare @constructor: !(Person.new()) : @Annot;
  14. */
  15. }