proguard.classfile.constant
Class StringConstant

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

public class StringConstant
extends Constant

This Constant represents a string constant in the constant pool.


Field Summary
 Clazz javaLangStringClass
          An extra field pointing to the java.lang.String Clazz object.
 Clazz referencedClass
          An extra field pointing to the referenced Clazz object, if this string is being used in Class.forName(), .class, or Class.getDeclaredField/Method constructs.
 Member referencedMember
          An extra field pointing to the referenced Member object, if this string is being used in Class.getDeclaredField/Method constructs.
 int u2stringIndex
           
 
Fields inherited from class proguard.classfile.constant.Constant
visitorInfo
 
Constructor Summary
StringConstant()
          Creates an uninitialized StringConstant.
StringConstant(int u2stringIndex, Clazz referencedClass, Member referenceMember)
          Creates a new StringConstant with the given string index.
 
Method Summary
 void accept(Clazz clazz, ConstantVisitor constantVisitor)
          Accepts the given visitor.
 java.lang.String getString(Clazz clazz)
          Returns the string value.
 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.
 void referencedMemberAccept(MemberVisitor memberVisitor)
          Lets the referenced member 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

u2stringIndex

public int u2stringIndex

referencedClass

public Clazz referencedClass
An extra field pointing to the referenced Clazz object, if this string is being used in Class.forName(), .class, or Class.getDeclaredField/Method constructs. This field is typically filled out by the DynamicClassReferenceInitializer or by the DynamicMemberReferenceInitializer.


referencedMember

public Member referencedMember
An extra field pointing to the referenced Member object, if this string is being used in Class.getDeclaredField/Method constructs. This field is typically filled out by the DynamicMemberReferenceInitializer.


javaLangStringClass

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

Constructor Detail

StringConstant

public StringConstant()
Creates an uninitialized StringConstant.


StringConstant

public StringConstant(int u2stringIndex,
                      Clazz referencedClass,
                      Member referenceMember)
Creates a new StringConstant with the given string index.

Parameters:
u2stringIndex - the index of the string in the constant pool.
referencedClass - the referenced class, if any.
referenceMember - the referenced class member, if any.
Method Detail

getString

public java.lang.String getString(Clazz clazz)
Returns the string value.


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.


referencedMemberAccept

public void referencedMemberAccept(MemberVisitor memberVisitor)
Lets the referenced member accept the given visitor.