KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > aval > annotation > ReplacesAnnotationInPackage


1 package spoon.aval.annotation;
2
3 import spoon.aval.annotation.structure.AValTarget;
4 import spoon.reflect.declaration.CtAnnotationType;
5
6
7 /**
8  * Meta annotation used to replace the implementation of an external
9  * annotation of the same name.
10  * <p>
11  * For example, to validate the java.lang.Override annotation (for which
12  * we do not have the source code), it suffices to create a (dummy) annotation called
13  * Override in any package, and meta annotate it with this annotation. The code
14  * of the dummy would be:
15  *
16  * <pre>
17  * &#64;ReplacesAnnotationInPackage("java.lang")
18  * public &#64;interface Overrides {
19  * }
20  * </pre>
21  */

22 @AValTarget(CtAnnotationType.class)
23 public @interface ReplacesAnnotationInPackage {
24     /**
25      * The package in which the annotation to replace is defined.
26      */

27     String JavaDoc value();
28 }
29
Popular Tags