Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
1234567891011121314151617181920 |
- import java.lang.annotation.*;
-
- @Retention(RetentionPolicy.RUNTIME)
- @interface Anno {}
-
- aspect Foo {
- declare @field: * Code2.someField: -@Anno;
-
- @Anno
- public int Code2.someField;
- }
-
- public class Code2 {
-
- public static void main(String[]argv) throws Exception {
- Object o = Code2.class.getDeclaredField("someField").getAnnotation(Anno.class);
- System.out.println(o==null?"no annotation":"has annotation");
- }
- }
|