001: /*******************************************************************************
002: * Copyright (c) 2000, 2005 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jdt.core.util;
011:
012: /**
013: * Description of an annotation component value as described in the JVM specifications
014: * (added in J2SE 1.5).
015: *
016: * This interface may be implemented by clients.
017: *
018: * @since 3.1
019: */
020: public interface IAnnotationComponentValue {
021:
022: /**
023: * Tag value for a constant of type <code>byte</code>
024: * @since 3.1
025: */
026: int BYTE_TAG = 'B';
027: /**
028: * Tag value for a constant of type <code>char</code>
029: * @since 3.1
030: */
031: int CHAR_TAG = 'C';
032: /**
033: * Tag value for a constant of type <code>double</code>
034: * @since 3.1
035: */
036: int DOUBLE_TAG = 'D';
037: /**
038: * Tag value for a constant of type <code>float</code>
039: * @since 3.1
040: */
041: int FLOAT_TAG = 'F';
042: /**
043: * Tag value for a constant of type <code>int</code>
044: * @since 3.1
045: */
046: int INTEGER_TAG = 'I';
047: /**
048: * Tag value for a constant of type <code>long</code>
049: * @since 3.1
050: */
051: int LONG_TAG = 'J';
052: /**
053: * Tag value for a constant of type <code>short</code>
054: * @since 3.1
055: */
056: int SHORT_TAG = 'S';
057: /**
058: * Tag value for a constant of type <code>boolean</code>
059: * @since 3.1
060: */
061: int BOOLEAN_TAG = 'Z';
062: /**
063: * Tag value for a constant of type <code>java.lang.String</code>
064: * @since 3.1
065: */
066: int STRING_TAG = 's';
067: /**
068: * Tag value for a value that represents an enum constant
069: * @since 3.1
070: */
071: int ENUM_TAG = 'e';
072: /**
073: * Tag value for a value that represents a class
074: * @since 3.1
075: */
076: int CLASS_TAG = 'c';
077: /**
078: * Tag value for a value that represents an annotation
079: * @since 3.1
080: */
081: int ANNOTATION_TAG = '@';
082: /**
083: * Tag value for a value that represents an array
084: * @since 3.1
085: */
086: int ARRAY_TAG = '[';
087:
088: /**
089: * Returns the annotation component values as described in the JVM specifications
090: * if the tag item is '['.
091: * Returns null otherwise.
092: *
093: * @return the annotation component values
094: */
095: IAnnotationComponentValue[] getAnnotationComponentValues();
096:
097: /**
098: * Returns the annotation value as described in the JVM specifications
099: * if the tag item is '@'.
100: * Returns null otherwise.
101: *
102: * @return the attribute value
103: * @since 3.1
104: */
105: IAnnotation getAnnotationValue();
106:
107: /**
108: * Returns the class info as described in the JVM specifications
109: * if the tag item is 'c'.
110: * Returns null otherwise.
111: *
112: * @return the class info
113: */
114: IConstantPoolEntry getClassInfo();
115:
116: /**
117: * Returns the class info index as described in the JVM specifications
118: * if the tag item is 'c'.
119: * Returns null otherwise.
120: *
121: * @return the class info index
122: */
123: int getClassInfoIndex();
124:
125: /**
126: * Returns the constant value as described in the JVM specifications
127: * if the tag item is one of 'B', 'C', 'D', 'F', 'I', 'J', 'S', 'Z', or 's'.
128: * Returns null otherwise.
129: *
130: * @return the constant value
131: */
132: IConstantPoolEntry getConstantValue();
133:
134: /**
135: * Returns the constant value index as described in the JVM specifications
136: * if the tag item is one of 'B', 'C', 'D', 'F', 'I', 'J', 'S', 'Z', or 's'.
137: * The value is unspecified otherwise.
138: *
139: * @return the constant value index
140: */
141: int getConstantValueIndex();
142:
143: /**
144: * Returns the simple name of the enum constant represented
145: * by this annotation component value as described in the JVM specifications
146: * if the tag item is 'e'.
147: * Returns null otherwise.
148: *
149: * @return the enum constant
150: * @since 3.1
151: */
152: char[] getEnumConstantName();
153:
154: /**
155: * Returns the utf8 constant index as described in the JVM specifications
156: * if the tag item is 'e'.
157: * The value is unspecified otherwise.
158: *
159: * @return the enum constant index
160: * @since 3.1
161: */
162: int getEnumConstantNameIndex();
163:
164: /**
165: * Returns the binary name of the type of the enum constant represented
166: * by this annotation component value as described in the JVM specifications
167: * if the tag item is 'e'.
168: * Returns null otherwise.
169: *
170: * @return the enum constant
171: * @since 3.1
172: */
173: char[] getEnumConstantTypeName();
174:
175: /**
176: * Returns the utf8 constant index as described in the JVM specifications
177: * if the tag item is 'e'.
178: * The value is unspecified otherwise.
179: *
180: * @return the enum constant index
181: * @since 3.1
182: */
183: int getEnumConstantTypeNameIndex();
184:
185: /**
186: * Returns the tag as described in the JVM specifications.
187: *
188: * @return the tag
189: */
190: int getTag();
191:
192: /**
193: * Returns the number of values as described in the JVM specifications
194: * if the tag item is '['.
195: * The value is unspecified otherwise.
196: *
197: * @return the number of values
198: */
199: int getValuesNumber();
200: }
|