1 11 package org.eclipse.jdt.internal.compiler.classfmt; 12 13 import org.eclipse.jdt.internal.compiler.env.IBinaryAnnotation; 14 15 public class MethodInfoWithAnnotations extends MethodInfo { 16 protected AnnotationInfo[] annotations; 17 18 MethodInfoWithAnnotations(MethodInfo methodInfo, AnnotationInfo[] annotations) { 19 super(methodInfo.reference, methodInfo.constantPoolOffsets, methodInfo.structOffset); 20 this.annotations = annotations; 21 22 this.accessFlags = methodInfo.accessFlags; 23 this.attributeBytes = methodInfo.attributeBytes; 24 this.descriptor = methodInfo.descriptor; 25 this.exceptionNames = methodInfo.exceptionNames; 26 this.name = methodInfo.name; 27 this.signature = methodInfo.signature; 28 this.signatureUtf8Offset = methodInfo.signatureUtf8Offset; 29 this.tagBits = methodInfo.tagBits; 30 } 31 public IBinaryAnnotation[] getAnnotations() { 32 return this.annotations; 33 } 34 protected void initialize() { 35 for (int i = 0, l = this.annotations == null ? 0 : this.annotations.length; i < l; i++) 36 if (this.annotations[i] != null) 37 this.annotations[i].initialize(); 38 super.initialize(); 39 } 40 protected void reset() { 41 for (int i = 0, l = this.annotations == null ? 0 : this.annotations.length; i < l; i++) 42 if (this.annotations[i] != null) 43 this.annotations[i].reset(); 44 super.reset(); 45 } 46 protected void toStringContent(StringBuffer buffer) { 47 super.toStringContent(buffer); 48 for (int i = 0, l = this.annotations == null ? 0 : this.annotations.length; i < l; i++) { 49 buffer.append(this.annotations[i]); 50 buffer.append('\n'); 51 } 52 } 53 } 54 | Popular Tags |