FileDocCategorySizeDatePackage
ClassCPInfo.javaAPI DocApache Ant 1.702808Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant.taskdefs.optional.depend.constantpool

ClassCPInfo

public class ClassCPInfo extends ConstantPoolEntry
The constant pool entry which stores class information.

Fields Summary
private String
className
The class' name. This will be only valid if the entry has been resolved against the constant pool.
private int
index
The index into the constant pool where this class' name is stored. If the class name is changed, this entry is invalid until this entry is connected to a constant pool.
Constructors Summary
public ClassCPInfo()
Constructor. Sets the tag value for this entry to type Class

        super(CONSTANT_CLASS, 1);
    
Methods Summary
public java.lang.StringgetClassName()
Get the class name of this entry.

return
the class' name.

        return className;
    
public voidread(java.io.DataInputStream cpStream)
Read the entry from a stream.

param
cpStream the stream containing the constant pool entry to be read.
exception
IOException thrown if there is a problem reading the entry from the stream.

        index = cpStream.readUnsignedShort();
        className = "unresolved";
    
public voidresolve(ConstantPool constantPool)
Resolve this class info against the given constant pool.

param
constantPool the constant pool with which to resolve the class.

        className = ((Utf8CPInfo) constantPool.getEntry(index)).getValue();

        super.resolve(constantPool);
    
public java.lang.StringtoString()
Generate a string readable version of this entry

return
string representation of this constant pool entry

        return "Class Constant Pool Entry for " + className + "[" + index + "]";