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.

AspectWithConstant.aj 613B

1234567891011121314151617
  1. import java.lang.annotation.*;
  2. public aspect AspectWithConstant {
  3. declare @field : * AspectWithConstant.MAX* : @Loggable;
  4. public static final int MAX = 9;
  5. public static final float MAXf = 9.0f;
  6. public static final double MAXd = 9.0d;
  7. public static final long MAXl = 9L;
  8. public static final Class MAXc = String.class;
  9. @Retention(RetentionPolicy.RUNTIME)
  10. @interface Loggable { }
  11. public static void main(String []argv) throws Exception {
  12. System.out.println("MAX="+MAX);
  13. System.out.println(AspectWithConstant.class.getDeclaredField("MAX").getAnnotation(Loggable.class));
  14. }
  15. }