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