Skip to main content
summaryrefslogtreecommitdiffstats
blob: d531c6e53000046a5a137962b28f6b5b3ff22604 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/*******************************************************************************
 * Copyright (c) 2000, 2009 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.core.util;

/**
 * Description of an annotation component value as described in the JVM specifications
 * (added in J2SE 1.5).
 *
 * This interface may be implemented by clients.
 *
 * @since 3.1
 */
public interface IAnnotationComponentValue {

	/**
	 * Tag value for a constant of type <code>byte</code>
	 * @since 3.1
	 */
	int BYTE_TAG = 'B';
	/**
	 * Tag value for a constant of type <code>char</code>
	 * @since 3.1
	 */
	int CHAR_TAG = 'C';
	/**
	 * Tag value for a constant of type <code>double</code>
	 * @since 3.1
	 */
	int DOUBLE_TAG = 'D';
	/**
	 * Tag value for a constant of type <code>float</code>
	 * @since 3.1
	 */
	int FLOAT_TAG = 'F';
	/**
	 * Tag value for a constant of type <code>int</code>
	 * @since 3.1
	 */
	int INTEGER_TAG = 'I';
	/**
	 * Tag value for a constant of type <code>long</code>
	 * @since 3.1
	 */
	int LONG_TAG = 'J';
	/**
	 * Tag value for a constant of type <code>short</code>
	 * @since 3.1
	 */
	int SHORT_TAG = 'S';
	/**
	 * Tag value for a constant of type <code>boolean</code>
	 * @since 3.1
	 */
	int BOOLEAN_TAG = 'Z';
	/**
	 * Tag value for a constant of type <code>java.lang.String</code>
	 * @since 3.1
	 */
	int STRING_TAG = 's';
	/**
	 * Tag value for a value that represents an enum constant
	 * @since 3.1
	 */
	int ENUM_TAG = 'e';
	/**
	 * Tag value for a value that represents a class
	 * @since 3.1
	 */
	int CLASS_TAG = 'c';
	/**
	 * Tag value for a value that represents an annotation
	 * @since 3.1
	 */
	int ANNOTATION_TAG = '@';
	/**
	 * Tag value for a value that represents an array
	 * @since 3.1
	 */
	int ARRAY_TAG = '[';

	/**
	 * Returns the annotation component values as described in the JVM specifications
	 * if the tag item is '['.
	 * Returns null otherwise.
	 *
	 * @return the annotation component values
	 */
	IAnnotationComponentValue[] getAnnotationComponentValues();

	/**
	 * Returns the annotation value as described in the JVM specifications
	 * if the tag item is '&#064;'.
	 * Returns null otherwise.
	 *
	 * @return the attribute value
	 * @since 3.1
	 */
	IAnnotation getAnnotationValue();

	/**
	 * Returns the class info as described in the JVM specifications
	 * if the tag item is 'c'.
	 * Returns null otherwise.
	 *
	 * @return the class info
	 */
	IConstantPoolEntry getClassInfo();

	/**
	 * Returns the class info index as described in the JVM specifications
	 * if the tag item is 'c'.
	 * Returns null otherwise.
	 *
	 * @return the class info index
	 */
	int getClassInfoIndex();

	/**
	 * Returns the constant value as described in the JVM specifications
	 * if the tag item is one of 'B', 'C', 'D', 'F', 'I', 'J', 'S', 'Z', or 's'.
	 * Returns null otherwise.
	 *
	 * @return the constant value
	 */
	IConstantPoolEntry getConstantValue();

	/**
	 * Returns the constant value index as described in the JVM specifications
	 * if the tag item is one of 'B', 'C', 'D', 'F', 'I', 'J', 'S', 'Z', or 's'.
	 * The value is unspecified otherwise.
	 *
	 * @return the constant value index
	 */
	int getConstantValueIndex();

	/**
	 * Returns the simple name of the enum constant represented
	 * by this annotation component value as described in the JVM specifications
	 * if the tag item is 'e'.
	 * Returns null otherwise.
	 *
	 * @return the enum constant
	 * @since 3.1
	 */
	char[] getEnumConstantName();

	/**
	 * Returns the utf8 constant index as described in the JVM specifications
	 * if the tag item is 'e'.
	 * The value is unspecified otherwise.
	 *
	 * @return the enum constant index
	 * @since 3.1
	 */
	int getEnumConstantNameIndex();

	/**
	 * Returns the binary name of the type of the enum constant represented
	 * by this annotation component value as described in the JVM specifications
	 * if the tag item is 'e'.
	 * Returns null otherwise.
	 *
	 * @return the enum constant
	 * @since 3.1
	 */
	char[] getEnumConstantTypeName();

	/**
	 * Returns the utf8 constant index as described in the JVM specifications
	 * if the tag item is 'e'.
	 * The value is unspecified otherwise.
	 *
	 * @return the enum constant index
	 * @since 3.1
	 */
	int getEnumConstantTypeNameIndex();

	/**
	 * Returns the tag as described in the JVM specifications.
	 *
	 * @return the tag
	 */
	int getTag();

	/**
	 * Returns the number of values as described in the JVM specifications
	 * if the tag item is '['.
	 * The value is unspecified otherwise.
	 *
	 * @return the number of values
	 */
	int getValuesNumber();
}

Back to the top