1 18 package org.apache.tools.ant.taskdefs.optional.depend.constantpool; 19 20 import java.io.DataInputStream ; 21 import java.io.IOException ; 22 23 27 public class ClassCPInfo extends ConstantPoolEntry { 28 29 33 private String className; 34 35 40 private int index; 41 42 45 public ClassCPInfo() { 46 super(CONSTANT_CLASS, 1); 47 } 48 49 57 public void read(DataInputStream cpStream) throws IOException { 58 index = cpStream.readUnsignedShort(); 59 className = "unresolved"; 60 } 61 62 67 public String toString() { 68 return "Class Constant Pool Entry for " + className + "[" + index + "]"; 69 } 70 71 77 public void resolve(ConstantPool constantPool) { 78 className = ((Utf8CPInfo) constantPool.getEntry(index)).getValue(); 79 80 super.resolve(constantPool); 81 } 82 83 88 public String getClassName() { 89 return className; 90 } 91 92 } 93 94 | Popular Tags |