You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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