| 1 26 package net.sf.javaguard.classfile; 27 28 import java.io.*; 29 30 31 36 public class ConstantValueAttrInfo extends AttrInfo { 37 38 private int constantValueIndex; 39 40 41 42 43 48 protected ConstantValueAttrInfo(ClassFile cf, int attrNameIndex, int attrLength) { 49 super(cf, attrNameIndex, attrLength); 50 } 51 52 53 54 55 58 protected String getAttrName() { 59 return ATTR_ConstantValue; 60 } 61 62 63 64 65 69 protected void setConstantValueIndex(int index) { 70 this.constantValueIndex = index; 71 } 72 73 74 78 protected int getConstantValueIndex() { 79 return constantValueIndex; 80 } 81 82 83 84 85 89 protected void readInfo(DataInput din) 90 throws IOException { 91 setConstantValueIndex(din.readUnsignedShort()); 92 } 93 94 95 100 public void writeInfo(DataOutput dout) 101 throws IOException { 102 dout.writeShort(getConstantValueIndex()); 103 } 104 105 106 107 108 112 public void dump(PrintWriter pw, ClassFile cf) { 113 pw.println(getAttrName()); 114 pw.print("constant value index: "); 115 pw.println(getConstantValueIndex()); 116 } 117 } 118 | Popular Tags |