1 6 7 package com.yworks.yguard.obf.classfile; 8 9 import java.io.DataInput ; 10 import java.io.DataOutput ; 11 import java.io.IOException ; 12 13 17 public class RuntimeVisibleAnnotationsAttrInfo extends AttrInfo 18 { 19 private int u2AnnotationCount; 20 private AnnotationInfo[] annotations; 21 22 23 public RuntimeVisibleAnnotationsAttrInfo(ClassFile cf, int attrNameIndex, int attrLength) 24 { 25 super(cf, attrNameIndex, attrLength); 26 } 27 28 protected String getAttrName() 29 { 30 return ClassConstants.ATTR_RuntimeVisibleAnnotations; 31 } 32 33 protected AnnotationInfo[] getAnnotations(){ 34 return annotations; 35 } 36 37 public void writeInfo(java.io.DataOutput dout) throws java.io.IOException 38 { 39 dout.writeShort(u2AnnotationCount); 40 for (int i = 0; i < u2AnnotationCount; i++){ 41 annotations[i].write(dout); 42 } 43 } 44 45 protected void readInfo(java.io.DataInput din) throws java.io.IOException 46 { 47 u2AnnotationCount = din.readUnsignedShort(); 48 annotations = new AnnotationInfo[u2AnnotationCount]; 49 for (int i = 0; i < u2AnnotationCount; i++){ 50 annotations[i] = AnnotationInfo.create(din); 51 } 52 } 53 54 protected void markUtf8RefsInInfo(ConstantPool pool) { 55 for (int i = 0; i < u2AnnotationCount; i++){ 56 annotations[i].markUtf8RefsInInfo(pool); 57 } 58 } 59 } 60 | Popular Tags |