KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > core > util > IAnnotationComponentValue


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

11 package org.eclipse.jdt.core.util;
12
13 /**
14  * Description of an annotation component value as described in the JVM specifications
15  * (added in J2SE 1.5).
16  *
17  * This interface may be implemented by clients.
18  *
19  * @since 3.1
20  */

21 public interface IAnnotationComponentValue {
22     
23     /**
24      * Tag value for a constant of type <code>byte</code>
25      * @since 3.1
26      */

27     int BYTE_TAG = 'B';
28     /**
29      * Tag value for a constant of type <code>char</code>
30      * @since 3.1
31      */

32     int CHAR_TAG = 'C';
33     /**
34      * Tag value for a constant of type <code>double</code>
35      * @since 3.1
36      */

37     int DOUBLE_TAG = 'D';
38     /**
39      * Tag value for a constant of type <code>float</code>
40      * @since 3.1
41      */

42     int FLOAT_TAG = 'F';
43     /**
44      * Tag value for a constant of type <code>int</code>
45      * @since 3.1
46      */

47     int INTEGER_TAG = 'I';
48     /**
49      * Tag value for a constant of type <code>long</code>
50      * @since 3.1
51      */

52     int LONG_TAG = 'J';
53     /**
54      * Tag value for a constant of type <code>short</code>
55      * @since 3.1
56      */

57     int SHORT_TAG = 'S';
58     /**
59      * Tag value for a constant of type <code>boolean</code>
60      * @since 3.1
61      */

62     int BOOLEAN_TAG = 'Z';
63     /**
64      * Tag value for a constant of type <code>java.lang.String</code>
65      * @since 3.1
66      */

67     int STRING_TAG = 's';
68     /**
69      * Tag value for a value that represents an enum constant
70      * @since 3.1
71      */

72     int ENUM_TAG = 'e';
73     /**
74      * Tag value for a value that represents a class
75      * @since 3.1
76      */

77     int CLASS_TAG = 'c';
78     /**
79      * Tag value for a value that represents an annotation
80      * @since 3.1
81      */

82     int ANNOTATION_TAG = '@';
83     /**
84      * Tag value for a value that represents an array
85      * @since 3.1
86      */

87     int ARRAY_TAG = '[';
88     
89     /**
90      * Returns the annotation component values as described in the JVM specifications
91      * if the tag item is '['.
92      * Returns null otherwise.
93      *
94      * @return the annotation component values
95      */

96     IAnnotationComponentValue[] getAnnotationComponentValues();
97     
98     /**
99      * Returns the annotation value as described in the JVM specifications
100      * if the tag item is '&#064;'.
101      * Returns null otherwise.
102      *
103      * @return the attribute value
104      * @since 3.1
105      */

106     IAnnotation getAnnotationValue();
107
108     /**
109      * Returns the class info as described in the JVM specifications
110      * if the tag item is 'c'.
111      * Returns null otherwise.
112      *
113      * @return the class info
114      */

115     IConstantPoolEntry getClassInfo();
116
117     /**
118      * Returns the class info index as described in the JVM specifications
119      * if the tag item is 'c'.
120      * Returns null otherwise.
121      *
122      * @return the class info index
123      */

124     int getClassInfoIndex();
125
126     /**
127      * Returns the constant value as described in the JVM specifications
128      * if the tag item is one of 'B', 'C', 'D', 'F', 'I', 'J', 'S', 'Z', or 's'.
129      * Returns null otherwise.
130      *
131      * @return the constant value
132      */

133     IConstantPoolEntry getConstantValue();
134
135     /**
136      * Returns the constant value index as described in the JVM specifications
137      * if the tag item is one of 'B', 'C', 'D', 'F', 'I', 'J', 'S', 'Z', or 's'.
138      * The value is unspecified otherwise.
139      *
140      * @return the constant value index
141      */

142     int getConstantValueIndex();
143
144     /**
145      * Returns the simple name of the enum constant represented
146      * by this annotation component value as described in the JVM specifications
147      * if the tag item is 'e'.
148      * Returns null otherwise.
149      *
150      * @return the enum constant
151      * @since 3.1
152      */

153     char[] getEnumConstantName();
154     
155     /**
156      * Returns the utf8 constant index as described in the JVM specifications
157      * if the tag item is 'e'.
158      * The value is unspecified otherwise.
159      *
160      * @return the enum constant index
161      * @since 3.1
162      */

163     int getEnumConstantNameIndex();
164
165     /**
166      * Returns the binary name of the type of the enum constant represented
167      * by this annotation component value as described in the JVM specifications
168      * if the tag item is 'e'.
169      * Returns null otherwise.
170      *
171      * @return the enum constant
172      * @since 3.1
173      */

174     char[] getEnumConstantTypeName();
175     
176     /**
177      * Returns the utf8 constant index as described in the JVM specifications
178      * if the tag item is 'e'.
179      * The value is unspecified otherwise.
180      *
181      * @return the enum constant index
182      * @since 3.1
183      */

184     int getEnumConstantTypeNameIndex();
185
186     /**
187      * Returns the tag as described in the JVM specifications.
188      *
189      * @return the tag
190      */

191     int getTag();
192     
193     /**
194      * Returns the number of values as described in the JVM specifications
195      * if the tag item is '['.
196      * The value is unspecified otherwise.
197      *
198      * @return the number of values
199      */

200     int getValuesNumber();
201 }
202
Popular Tags