@@ -43,12 +43,12 @@ public static AnnotationEntry[] createAnnotationEntries(final Attribute[] attrib
4343 }
4444
4545 /**
46- * Factory method to create an AnnotionEntry from a DataInput
46+ * Factory method to create an AnnotionEntry from a DataInput.
4747 *
48- * @param input
49- * @param constantPool
50- * @param isRuntimeVisible
51- * @return the entry
48+ * @param input the input stream.
49+ * @param constantPool the constant pool.
50+ * @param isRuntimeVisible whether the annotation is runtime visible.
51+ * @return the entry.
5252 * @throws IOException if an I/O error occurs.
5353 */
5454 public static AnnotationEntry read (final DataInput input , final ConstantPool constantPool , final boolean isRuntimeVisible ) throws IOException {
@@ -87,10 +87,21 @@ public void accept(final Visitor v) {
8787 v .visitAnnotationEntry (this );
8888 }
8989
90+ /**
91+ * Adds an element name value pair.
92+ *
93+ * @param elementNameValuePair the element name value pair.
94+ */
9095 public void addElementNameValuePair (final ElementValuePair elementNameValuePair ) {
9196 elementValuePairs .add (elementNameValuePair );
9297 }
9398
99+ /**
100+ * Dumps this annotation entry to a DataOutputStream.
101+ *
102+ * @param dos the output stream.
103+ * @throws IOException if an I/O error occurs.
104+ */
94105 public void dump (final DataOutputStream dos ) throws IOException {
95106 dos .writeShort (typeIndex ); // u2 index of type name in cpool
96107 dos .writeShort (elementValuePairs .size ()); // u2 element_value pair
@@ -101,46 +112,74 @@ public void dump(final DataOutputStream dos) throws IOException {
101112 }
102113
103114 /**
104- * @return the annotation type name
115+ * Gets the annotation type name.
116+ *
117+ * @return the annotation type name.
105118 */
106119 public String getAnnotationType () {
107120 return constantPool .getConstantUtf8 (typeIndex ).getBytes ();
108121 }
109122
110123 /**
111- * @return the annotation type index
124+ * Gets the annotation type index.
125+ *
126+ * @return the annotation type index.
112127 */
113128 public int getAnnotationTypeIndex () {
114129 return typeIndex ;
115130 }
116131
132+ /**
133+ * Gets the constant pool.
134+ *
135+ * @return the constant pool.
136+ */
117137 public ConstantPool getConstantPool () {
118138 return constantPool ;
119139 }
120140
121141 /**
122- * @return the element value pairs in this annotation entry
142+ * Gets the element value pairs in this annotation entry.
143+ *
144+ * @return the element value pairs in this annotation entry.
123145 */
124146 public ElementValuePair [] getElementValuePairs () {
125147 // TODO return List
126148 return elementValuePairs .toArray (ElementValuePair .EMPTY_ARRAY );
127149 }
128150
129151 /**
130- * @return the number of element value pairs in this annotation entry
152+ * Gets the number of element value pairs in this annotation entry.
153+ *
154+ * @return the number of element value pairs in this annotation entry.
131155 */
132156 public final int getNumElementValuePairs () {
133157 return elementValuePairs .size ();
134158 }
135159
160+ /**
161+ * Gets the type index.
162+ *
163+ * @return the type index.
164+ */
136165 public int getTypeIndex () {
137166 return typeIndex ;
138167 }
139168
169+ /**
170+ * Gets whether this annotation is runtime visible.
171+ *
172+ * @return true if this annotation is runtime visible.
173+ */
140174 public boolean isRuntimeVisible () {
141175 return isRuntimeVisible ;
142176 }
143177
178+ /**
179+ * Gets a short string representation of this annotation.
180+ *
181+ * @return a short string representation of this annotation.
182+ */
144183 public String toShortString () {
145184 final StringBuilder result = new StringBuilder ();
146185 result .append ("@" );
0 commit comments