blob: 0cbbe9ce9db6b4dd24f9818c31069c7c6d295c22 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import java.lang.annotation.*;
public aspect AspectWithConstant {
declare @field : * AspectWithConstant.MAX* : @Loggable;
public static final String MAXS = "hello";
@Retention(RetentionPolicy.RUNTIME)
@interface Loggable { }
public static void main(String []argv) throws Exception {
System.out.println("MAXS="+MAXS);
System.out.println(AspectWithConstant.class.getDeclaredField("MAXS").getAnnotation(Loggable.class));
}
}
|