Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

AspectDeclareAnnotations.aj 531B

12345678910111213141516171819202122232425
  1. // little aspect and class for testing declaration of annotations
  2. @interface anInterface {}
  3. public aspect AspectDeclareAnnotations{
  4. declare @type : Test : @anInterface;
  5. declare @constructor : Test.new(String,int) : @anInterface;
  6. declare @method : int Test.fac(int) : @anInterface;
  7. declare @field : int Test.a : @anInterface;
  8. }
  9. class Test{
  10. public Test(String say, int something){
  11. System.out.println(say + something);
  12. }
  13. public int fac(int n){
  14. return (n == 0)? 1 : n * fac(n-1);
  15. }
  16. public int a = 1;
  17. }