ProGuard

proguard.classfile
Class NameAndTypeCpInfo

java.lang.Object
  extended byproguard.classfile.CpInfo
      extended byproguard.classfile.NameAndTypeCpInfo
All Implemented Interfaces:
Cloneable, VisitorAccepter

public class NameAndTypeCpInfo
extends CpInfo
implements Cloneable

Representation of a 'name and type' entry in the ConstantPool.


Field Summary
 ClassFile[] referencedClassFiles
          An extra field pointing to the ClassFile objects referenced in the descriptor string.
 int u2descriptorIndex
           
 int u2nameIndex
           
 
Fields inherited from class proguard.classfile.CpInfo
visitorInfo
 
Constructor Summary
protected NameAndTypeCpInfo()
           
  NameAndTypeCpInfo(int u2nameIndex, int u2descriptorIndex, ClassFile[] referencedClassFiles)
          Creates a new NameAndTypeCpInfo with the given name and type indices.
 
Method Summary
 void accept(ClassFile classFile, CpInfoVisitor cpInfoVisitor)
          Accepts the given visitor.
protected  int getDescriptorIndex()
          Returns the descriptor index.
 String getName(ClassFile classFile)
          Returns the name.
protected  int getNameIndex()
          Returns the name index.
 int getTag()
          Returns the class pool info tag that specifies the entry type.
 String getType(ClassFile classFile)
          Returns the type.
protected  void readInfo(DataInput din)
          Reads the 'info' data following the u1tag byte.
 void referencedClassesAccept(ClassFileVisitor classFileVisitor)
          Lets the ClassFile objects referenced in the descriptor string accept the given visitor.
protected  void setDescriptorIndex(int index)
          Sets the descriptor index.
protected  void setNameIndex(int index)
          Sets the name index.
protected  void writeInfo(DataOutput dout)
          Writes the 'info' data following the u1tag byte.
 
Methods inherited from class proguard.classfile.CpInfo
create, createOrShare, getVisitorInfo, setVisitorInfo, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

u2nameIndex

public int u2nameIndex

u2descriptorIndex

public int u2descriptorIndex

referencedClassFiles

public ClassFile[] referencedClassFiles
An extra field pointing to the ClassFile objects referenced in the descriptor string. This field is filled out by the ClassFileReferenceInitializer. References to primitive types are ignored.

Constructor Detail

NameAndTypeCpInfo

protected NameAndTypeCpInfo()

NameAndTypeCpInfo

public NameAndTypeCpInfo(int u2nameIndex,
                         int u2descriptorIndex,
                         ClassFile[] referencedClassFiles)
Creates a new NameAndTypeCpInfo with the given name and type indices.

Parameters:
u2nameIndex - the index of the name in the constant pool.
u2descriptorIndex - the index of the descriptor in the constant pool.
referencedClassFiles - the list of class files referenced in the descriptor string.
Method Detail

getNameIndex

protected int getNameIndex()
Returns the name index.


setNameIndex

protected void setNameIndex(int index)
Sets the name index.


getDescriptorIndex

protected int getDescriptorIndex()
Returns the descriptor index.


setDescriptorIndex

protected void setDescriptorIndex(int index)
Sets the descriptor index.


getName

public String getName(ClassFile classFile)
Returns the name.


getType

public String getType(ClassFile classFile)
Returns the type.


getTag

public int getTag()
Description copied from class: CpInfo
Returns the class pool info tag that specifies the entry type.

Specified by:
getTag in class CpInfo

readInfo

protected void readInfo(DataInput din)
                 throws IOException
Description copied from class: CpInfo
Reads the 'info' data following the u1tag byte.

Specified by:
readInfo in class CpInfo
Throws:
IOException

writeInfo

protected void writeInfo(DataOutput dout)
                  throws IOException
Description copied from class: CpInfo
Writes the 'info' data following the u1tag byte.

Specified by:
writeInfo in class CpInfo
Throws:
IOException

accept

public void accept(ClassFile classFile,
                   CpInfoVisitor cpInfoVisitor)
Description copied from class: CpInfo
Accepts the given visitor.

Specified by:
accept in class CpInfo

referencedClassesAccept

public void referencedClassesAccept(ClassFileVisitor classFileVisitor)
Lets the ClassFile objects referenced in the descriptor string accept the given visitor.


ProGuard