proguard.classfile.constant
Class ClassConstant

java.lang.Object
  extended by proguard.classfile.constant.Constant
      extended by proguard.classfile.constant.ClassConstant
All Implemented Interfaces:
VisitorAccepter

public class ClassConstant
extends Constant

This Constant represents a class constant in the constant pool.


Field Summary
 Clazz javaLangClassClass
          An extra field pointing to the java.lang.Class Clazz object.
 Clazz referencedClass
          An extra field pointing to the referenced Clazz object.
 int u2nameIndex
           
 
Fields inherited from class proguard.classfile.constant.Constant
visitorInfo
 
Constructor Summary
ClassConstant()
          Creates an uninitialized ClassConstant.
ClassConstant(int u2nameIndex, Clazz referencedClass)
          Creates a new ClassConstant with the given name index.
 
Method Summary
 void accept(Clazz clazz, ConstantVisitor constantVisitor)
          Accepts the given visitor.
 java.lang.String getName(Clazz clazz)
          Returns the name.
 int getTag()
          Returns the constant pool info tag that specifies the entry type.
 void referencedClassAccept(ClassVisitor classVisitor)
          Lets the referenced class accept the given visitor.
 
Methods inherited from class proguard.classfile.constant.Constant
getVisitorInfo, setVisitorInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

u2nameIndex

public int u2nameIndex

referencedClass

public Clazz referencedClass
An extra field pointing to the referenced Clazz object. This field is filled out by the ClassReferenceInitializer.


javaLangClassClass

public Clazz javaLangClassClass
An extra field pointing to the java.lang.Class Clazz object. This field is typically filled out by the ClassReferenceInitializer..

Constructor Detail

ClassConstant

public ClassConstant()
Creates an uninitialized ClassConstant.


ClassConstant

public ClassConstant(int u2nameIndex,
                     Clazz referencedClass)
Creates a new ClassConstant with the given name index.

Parameters:
u2nameIndex - the index of the name in the constant pool.
referencedClass - the referenced class.
Method Detail

getName

public java.lang.String getName(Clazz clazz)
Returns the name.


getTag

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

Specified by:
getTag in class Constant

accept

public void accept(Clazz clazz,
                   ConstantVisitor constantVisitor)
Description copied from class: Constant
Accepts the given visitor.

Specified by:
accept in class Constant

referencedClassAccept

public void referencedClassAccept(ClassVisitor classVisitor)
Lets the referenced class accept the given visitor.