1 26 package net.sf.javaguard.classfile; 27 28 import java.io.*; 29 30 31 36 public class SourceFileAttrInfo extends AttrInfo { 37 38 private int sourceFileIndex; 39 40 41 42 43 48 protected SourceFileAttrInfo(ClassFile cf, int attrNameIndex, int attrLength) { 49 super(cf, attrNameIndex, attrLength); 50 } 51 52 53 54 55 58 protected String getAttrName() { 59 return ATTR_SourceFile; 60 } 61 62 63 64 65 69 protected void setSourceFileIndex(int index) { 70 sourceFileIndex = index; 71 } 72 73 74 78 protected int getSourceFileIndex() { 79 return sourceFileIndex; 80 } 81 82 83 84 85 89 protected void markUtf8RefsInInfo(ConstantPool pool) { 90 pool.incRefCount(getSourceFileIndex()); 91 } 92 93 94 95 96 100 protected void readInfo(DataInput din) 101 throws IOException { 102 setSourceFileIndex(din.readUnsignedShort()); 103 } 104 105 106 111 public void writeInfo(DataOutput dout) 112 throws IOException { 113 dout.writeShort(getSourceFileIndex()); 114 } 115 116 117 118 119 123 public void dump(PrintWriter pw, ClassFile cf) { 124 pw.println(getAttrName()); 125 pw.print("Source file index: "); 126 pw.println(getSourceFileIndex()); 127 } 128 } 129 | Popular Tags |