1 26 package com.yworks.yguard.obf.classfile; 27 28 import java.io.*; 29 import java.util.*; 30 31 36 public class EnclosingMethodAttrInfo extends AttrInfo 37 { 38 40 41 private int u2classIndex; 43 private int u2nameAndTypeIndex; 44 45 46 48 49 protected EnclosingMethodAttrInfo(ClassFile cf, int attrNameIndex, int attrLength) 51 { 52 super(cf, attrNameIndex, attrLength); 53 } 54 55 56 protected String getAttrName() 57 { 58 return ATTR_EnclosingMethod; 59 } 60 61 62 protected int getClassIndex() {return u2classIndex;} 63 64 65 protected void setClassIndex(int index) { this.u2classIndex = index; } 66 67 68 protected int getNameAndTypeIndex() {return u2nameAndTypeIndex;} 69 70 71 protected void setNameAndTypeIndex(int index) {u2nameAndTypeIndex = index;} 72 73 77 protected void markUtf8RefsInInfo(ConstantPool pool) { 78 if (u2nameAndTypeIndex > 0){ 83 NameAndTypeCpInfo ntcpi = (NameAndTypeCpInfo) pool.getCpEntry(u2nameAndTypeIndex); 84 ntcpi.incRefCount(); 85 } 86 } 91 92 93 94 95 96 protected void readInfo(DataInput din) throws java.io.IOException 97 { 98 u2classIndex = din.readUnsignedShort(); 99 u2nameAndTypeIndex = din.readUnsignedShort(); 100 } 101 102 103 public void writeInfo(DataOutput dout) throws java.io.IOException 104 { 105 dout.writeShort(u2classIndex); 106 dout.writeShort(u2nameAndTypeIndex); 107 } 108 109 110 public void dump(PrintWriter pw, ClassFile cf, int index) 111 { 112 pw.println(" EnclosingMethod " ); 113 } 117 } 118 119 | Popular Tags |