KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > aspectj > lang > reflect > DeclareAnnotation


1 /* *******************************************************************
2  * Copyright (c) 2005 Contributors.
3  * All rights reserved.
4  * This program and the accompanying materials are made available
5  * under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution and is available at
7  * http://eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Adrian Colyer Initial implementation
11  * ******************************************************************/

12 package org.aspectj.lang.reflect;
13
14 import java.lang.annotation.Annotation JavaDoc;
15
16 /**
17  * The AspectJ runtime representation of a declare annotation member in an aspect.
18  *
19  */

20 public interface DeclareAnnotation {
21     
22     public enum Kind { Field, Method, Constructor, Type };
23     
24     /**
25      * The aspect that declared this member.
26      */

27     AjType<?> getDeclaringType();
28     
29     /**
30      * The target element kind
31      */

32     Kind getKind();
33     
34     /**
35      * The target signature pattern. Returns null if getKind() == Type
36      */

37     SignaturePattern getSignaturePattern();
38     
39     /**
40      * The target type pattern. Returns null if getKind() != Type
41      */

42     TypePattern getTypePattern();
43     
44     /**
45      * The declared annotation. If the declared annotation does not have runtime retention,
46      * this method returns null.
47      */

48     Annotation JavaDoc getAnnotation();
49     
50     /**
51      * Returns the text of the annotation as declared in this member. Available for
52      * both runtime and class-file retention annotations
53      */

54     String JavaDoc getAnnotationAsText();
55     
56 }
57
Popular Tags