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

MethodRefCPInfo

public class MethodRefCPInfo extends ConstantPoolEntry
A MethodRef CP Info

Fields Summary
private String
methodClassName
the name of the class defining this method
private String
methodName
the name of the method
private String
methodType
the method's type descriptor
private int
classIndex
The index into the constant pool which defines the class of this method.
private int
nameAndTypeIndex
the index into the constant pool which defined the name and type signature of the method
Constructors Summary
public MethodRefCPInfo()
Constructor.

        super(CONSTANT_METHODREF, 1);
    
Methods Summary
public java.lang.StringgetMethodClassName()
Get the name of the class defining the method

return
the name of the class defining this method

        return methodClassName;
    
public java.lang.StringgetMethodName()
Get the name of the method.

return
the name of the method.

        return methodName;
    
public java.lang.StringgetMethodType()
Get the type signature of the method.

return
the type signature of the method.

        return methodType;
    
public voidread(java.io.DataInputStream cpStream)
read a constant pool entry from a class stream.

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

        classIndex = cpStream.readUnsignedShort();
        nameAndTypeIndex = cpStream.readUnsignedShort();
    
public voidresolve(ConstantPool constantPool)
Resolve this constant pool entry with respect to its dependents in the constant pool.

param
constantPool the constant pool of which this entry is a member and against which this entry is to be resolved.

        ClassCPInfo methodClass
             = (ClassCPInfo) constantPool.getEntry(classIndex);

        methodClass.resolve(constantPool);

        methodClassName = methodClass.getClassName();

        NameAndTypeCPInfo nt
             = (NameAndTypeCPInfo) constantPool.getEntry(nameAndTypeIndex);

        nt.resolve(constantPool);

        methodName = nt.getName();
        methodType = nt.getType();

        super.resolve(constantPool);
    
public java.lang.StringtoString()
Print a readable version of the constant pool entry.

return
the string representation of this constant pool entry.

        String value;

        if (isResolved()) {
            value = "Method : Class = " + methodClassName + ", name = "
                 + methodName + ", type = " + methodType;
        } else {
            value = "Method : Class index = " + classIndex
                 + ", name and type index = " + nameAndTypeIndex;
        }

        return value;