KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > compiler > classfmt > AnnotationMethodInfoWithAnnotations


1 /*******************************************************************************
2  * Copyright (c) 2005, 2007 BEA Systems, Inc.
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  * tyeung@bea.com - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.compiler.classfmt;
12
13 import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation;
14
15 public class AnnotationMethodInfoWithAnnotations extends AnnotationMethodInfo {
16     private AnnotationInfo[] annotations;
17
18 AnnotationMethodInfoWithAnnotations(MethodInfo methodInfo, Object JavaDoc defaultValue, AnnotationInfo[] annotations) {
19     super(methodInfo, defaultValue);
20     this.annotations = annotations;
21 }
22 public IBinaryAnnotation[] getAnnotations() {
23     return this.annotations;
24 }
25 protected void initialize() {
26     for (int i = 0, l = this.annotations == null ? 0 : this.annotations.length; i < l; i++)
27         if (this.annotations[i] != null)
28             this.annotations[i].initialize();
29     super.initialize();
30 }
31 protected void reset() {
32     for (int i = 0, l = this.annotations == null ? 0 : this.annotations.length; i < l; i++)
33         if (this.annotations[i] != null)
34             this.annotations[i].reset();
35     super.reset();
36 }
37 protected void toStringContent(StringBuffer JavaDoc buffer) {
38     super.toStringContent(buffer);
39     for (int i = 0, l = this.annotations == null ? 0 : this.annotations.length; i < l; i++) {
40         buffer.append(this.annotations[i]);
41         buffer.append('\n');
42     }
43 }
44 }
45
Popular Tags